[Attributor] Deduce "nosync" function attribute.

Introduce and deduce "nosync" function attribute to indicate that a function
does not synchronize with another thread in a way that other thread might free memory.

Reviewers: jdoerfert, jfb, nhaehnle, arsenm

Subscribers: wdng, hfinkel, nhaenhle, mehdi_amini, steven_wu,
dexonsmith, arsenm, uenoku, hiraditya, jfb, llvm-commits

Differential Revision: https://reviews.llvm.org/D62766

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stefan Stipanovic
2019-07-11 21:37:40 +00:00
parent 97e268381d
commit 52d4c048b3
19 changed files with 675 additions and 60 deletions
+10 -3
View File
@@ -203,8 +203,8 @@ declare void @nobuiltin()
define void @f34()
; CHECK: define void @f34()
{
call void @nobuiltin() nobuiltin
; CHECK: call void @nobuiltin() #38
call void @nobuiltin() nobuiltin
; CHECK: call void @nobuiltin() #39
ret void;
}
@@ -362,6 +362,12 @@ define void @f61() nofree {
ret void
}
; CHECK: define void @f62() #38
define void @f62() nosync
{
ret void
}
; CHECK: attributes #0 = { noreturn }
; CHECK: attributes #1 = { nounwind }
; CHECK: attributes #2 = { readnone }
@@ -400,4 +406,5 @@ define void @f61() nofree {
; CHECK: attributes #35 = { shadowcallstack }
; CHECK: attributes #36 = { willreturn }
; CHECK: attributes #37 = { nofree }
; CHECK: attributes #38 = { nobuiltin }
; CHECK: attributes #38 = { nosync }
; CHECK: attributes #39 = { nobuiltin }