diff options
| author | Davide Italiano <davide@freebsd.org> | 2017-02-01 18:52:20 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2017-02-01 18:52:20 +0000 |
| commit | 6849f20d8524c570ece1c24e0af4c0d6889763f4 (patch) | |
| tree | c462afba452035feba9f8c0fcc712c10353f5a10 /llvm/test | |
| parent | ac9c30c37fcbd5f5d23e976e42e28375d28356dd (diff) | |
| download | bcm5719-llvm-6849f20d8524c570ece1c24e0af4c0d6889763f4.tar.gz bcm5719-llvm-6849f20d8524c570ece1c24e0af4c0d6889763f4.zip | |
[IPSCCP] Don't propagate return values of functions marked as noinline.
This tries to address what Hal defined (in the post-commit review of
r293727) a long-standing problem with noinline, where we end up
de facto inlining trivial functions e.g.
__attribute__((noinline)) int patatino(void) { return 5; }
because of return value propagation.
llvm-svn: 293799
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/Transforms/IPConstantProp/noinline-return.ll | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Transforms/IPConstantProp/noinline-return.ll b/llvm/test/Transforms/IPConstantProp/noinline-return.ll new file mode 100644 index 00000000000..10950327327 --- /dev/null +++ b/llvm/test/Transforms/IPConstantProp/noinline-return.ll @@ -0,0 +1,21 @@ +; RUN: opt %s -ipsccp -S | FileCheck %s + +define i32 @tinkywinky() #0 { +entry: + ret i32 5 +} + +define i32 @patatino() { +entry: + %call = call i32 @tinkywinky() + +; Check that we don't propagate the return value of +; @tinkywinky. +; CHECK: call i32 @dipsy(i32 %call) + %call1 = call i32 @dipsy(i32 %call) + ret i32 %call1 +} + +declare i32 @dipsy(i32) + +attributes #0 = { noinline } |

