diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-23 18:49:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-23 18:49:30 +0000 |
commit | 818ff34bc0841edda10951b7b043076b6e7159ef (patch) | |
tree | c98b6b028a742d8c58e9b2cf66a33ce49ae1b35e /test/Transforms/InstCombine/intrinsics.ll | |
parent | a9cf5b3cc9082acee5b6e30e989a667fed286b05 (diff) | |
download | llvm-818ff34bc0841edda10951b7b043076b6e7159ef.tar.gz llvm-818ff34bc0841edda10951b7b043076b6e7159ef.tar.bz2 llvm-818ff34bc0841edda10951b7b043076b6e7159ef.tar.xz |
implement a simple instcombine xform that has been in the
readme forever.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94318 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/intrinsics.ll')
-rw-r--r-- | test/Transforms/InstCombine/intrinsics.ll | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/intrinsics.ll b/test/Transforms/InstCombine/intrinsics.ll index c63475c2bd..08dcfa731a 100644 --- a/test/Transforms/InstCombine/intrinsics.ll +++ b/test/Transforms/InstCombine/intrinsics.ll @@ -144,3 +144,18 @@ entry: ; CHECK-NEXT: %pop.cmp = icmp eq i32 %b, 0 ; CHECK-NEXT: volatile store i1 %pop.cmp, i1* %c } + + +define i32 @cttz_simplify1(i32 %x) nounwind readnone ssp { + %tmp1 = tail call i32 @llvm.ctlz.i32(i32 %x) ; <i32> [#uses=1] + %shr3 = lshr i32 %tmp1, 5 ; <i32> [#uses=1] + ret i32 %shr3 + +; CHECK: @cttz_simplify1 +; CHECK: icmp eq i32 %x, 0 +; CHECK-NEXT: zext i1 +; CHECK-NEXT: ret i32 +} + +declare i32 @llvm.ctlz.i32(i32) nounwind readnone + |