summaryrefslogtreecommitdiffstats
path: root/llvm/test/Analysis
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2015-11-12 08:53:04 +0000
committerJames Molloy <james.molloy@arm.com>2015-11-12 08:53:04 +0000
commitb14994e7525d20cb97ce9ebef18802cb038c5d66 (patch)
tree61362001c7b92ecfea48d181b7e538ec35931ada /llvm/test/Analysis
parent71a51ff10ee175f3dadc40062950a8110ce4e832 (diff)
downloadbcm5719-llvm-b14994e7525d20cb97ce9ebef18802cb038c5d66.tar.gz
bcm5719-llvm-b14994e7525d20cb97ce9ebef18802cb038c5d66.zip
[FunctionAttrs] Identify norecurse functions
A function can be marked as norecurse if: * The SCC to which it belongs has cardinality 1; and either a) It does not call any non-norecurse function. This includes self-recursion; or b) It only has one callsite and the function that callsite is within is marked norecurse. a) is best propagated bottom-up and b) is best propagated top-down. We build up the norecurse attributes bottom-up using the existing SCC pass, and mark functions with no obvious recursion (but not provably norecurse) to sweep later, top-down. llvm-svn: 252862
Diffstat (limited to 'llvm/test/Analysis')
-rw-r--r--llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll b/llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
index 6c9439afeea..44031417032 100644
--- a/llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
+++ b/llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
@@ -30,7 +30,7 @@ define void @test1_yes(i32* %p) nounwind {
ret void
}
-; CHECK: define void @test1_no(i32* %p) #1 {
+; CHECK: define void @test1_no(i32* %p) #3 {
define void @test1_no(i32* %p) nounwind {
call void @callee(i32* %p), !tbaa !2
ret void
@@ -72,9 +72,11 @@ define i32 @test3_no(i8* %p) nounwind {
declare void @callee(i32* %p) nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1) nounwind
-; CHECK: attributes #0 = { nounwind readnone }
-; CHECK: attributes #1 = { nounwind }
+; CHECK: attributes #0 = { norecurse nounwind readnone }
+; CHECK: attributes #1 = { norecurse nounwind }
; CHECK: attributes #2 = { nounwind readonly }
+; CHECK: attributes #3 = { nounwind }
+; CHECK: attributes #4 = { nounwind argmemonly }
; Root note.
!0 = !{ }
OpenPOWER on IntegriCloud