diff options
author | Hal Finkel <hfinkel@anl.gov> | 2016-07-11 02:25:14 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2016-07-11 02:25:14 +0000 |
commit | 6fd5e1f02bf414803a86b6877a61818fb8914597 (patch) | |
tree | e69204f7571fba59219e0c26b47a75eb3f3df16b /llvm/test/Transforms/InstCombine/align-attr.ll | |
parent | 5c12d8fe8f7ac9a3ec13ddad1561d63477e014f6 (diff) | |
download | bcm5719-llvm-6fd5e1f02bf414803a86b6877a61818fb8914597.tar.gz bcm5719-llvm-6fd5e1f02bf414803a86b6877a61818fb8914597.zip |
Teach computeKnownBits to look through returned-argument functions
If a function is known to return one of its arguments, we can use that in order
to compute known bits of the return value.
Differential Revision: http://reviews.llvm.org/D9397
llvm-svn: 275036
Diffstat (limited to 'llvm/test/Transforms/InstCombine/align-attr.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/align-attr.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/align-attr.ll b/llvm/test/Transforms/InstCombine/align-attr.ll index 99a17db13c4..75a3766b7d1 100644 --- a/llvm/test/Transforms/InstCombine/align-attr.ll +++ b/llvm/test/Transforms/InstCombine/align-attr.ll @@ -13,3 +13,16 @@ entry: ; CHECK: ret i32 } +define i32 @foo2(i32* align 32 %a) #0 { +entry: + %v = call i32* @func1(i32* %a) + %0 = load i32, i32* %v, align 4 + ret i32 %0 + +; CHECK-LABEL: @foo2 +; CHECK-DAG: load i32, i32* %v, align 32 +; CHECK: ret i32 +} + +declare i32* @func1(i32* returned) nounwind + |