diff options
author | James Molloy <james.molloy@arm.com> | 2015-11-12 08:53:04 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2015-11-12 08:53:04 +0000 |
commit | b14994e7525d20cb97ce9ebef18802cb038c5d66 (patch) | |
tree | 61362001c7b92ecfea48d181b7e538ec35931ada /llvm/test/Transforms/FunctionAttrs/optnone.ll | |
parent | 71a51ff10ee175f3dadc40062950a8110ce4e832 (diff) | |
download | bcm5719-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/Transforms/FunctionAttrs/optnone.ll')
-rw-r--r-- | llvm/test/Transforms/FunctionAttrs/optnone.ll | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/optnone.ll b/llvm/test/Transforms/FunctionAttrs/optnone.ll index 7694bfe13aa..441ff4da65e 100644 --- a/llvm/test/Transforms/FunctionAttrs/optnone.ll +++ b/llvm/test/Transforms/FunctionAttrs/optnone.ll @@ -16,9 +16,11 @@ define void @test_optnone(i8* %p) noinline optnone { declare i8 @strlen(i8*) noinline optnone ; CHECK-LABEL: @strlen -; CHECK: (i8*) #1 +; CHECK: (i8*) #2 ; CHECK-LABEL: attributes #0 -; CHECK: = { readnone } +; CHECK: = { norecurse readnone } ; CHECK-LABEL: attributes #1 +; CHECK: = { noinline norecurse optnone } +; CHECK-LABEL: attributes #2 ; CHECK: = { noinline optnone } |