diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2011-12-24 22:34:15 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2011-12-24 22:34:15 +0000 |
| commit | 8b7e71ffd6f353352f2a20c1b056bf7a3422a36d (patch) | |
| tree | 333a19099f5c4f230af45c2a49cb03a3bd8b2b8a /llvm/test/Transforms | |
| parent | 966c1fb0c8e88e1806a38118b03e805e2ab4ff2d (diff) | |
| download | bcm5719-llvm-8b7e71ffd6f353352f2a20c1b056bf7a3422a36d.tar.gz bcm5719-llvm-8b7e71ffd6f353352f2a20c1b056bf7a3422a36d.zip | |
Add an explicit test that we now fold cttz.i32(..., true) >> 5 -> 0.
This is a result of Benjamin's work on ValueTracking.
llvm-svn: 147259
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/InstCombine/intrinsics.ll | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/llvm/test/Transforms/InstCombine/intrinsics.ll b/llvm/test/Transforms/InstCombine/intrinsics.ll index 7ae6d5a969a..382e6b38574 100644 --- a/llvm/test/Transforms/InstCombine/intrinsics.ll +++ b/llvm/test/Transforms/InstCombine/intrinsics.ll @@ -201,16 +201,22 @@ entry: ; CHECK-NEXT: store volatile i1 %pop.cmp, i1* %c } - -define i32 @cttz_simplify1(i32 %x) nounwind readnone ssp { - %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false) ; <i32> [#uses=1] - %shr3 = lshr i32 %tmp1, 5 ; <i32> [#uses=1] +define i32 @cttz_simplify1a(i32 %x) nounwind readnone ssp { + %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %x, i1 false) + %shr3 = lshr i32 %tmp1, 5 ret i32 %shr3 - -; CHECK: @cttz_simplify1 + +; CHECK: @cttz_simplify1a ; CHECK: icmp eq i32 %x, 0 -; CHECK-NEXT: zext i1 +; CHECK-NEXT: zext i1 ; CHECK-NEXT: ret i32 } +define i32 @cttz_simplify1b(i32 %x) nounwind readnone ssp { + %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %x, i1 true) + %shr3 = lshr i32 %tmp1, 5 + ret i32 %shr3 +; CHECK: @cttz_simplify1b +; CHECK-NEXT: ret i32 0 +} |

