We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6a33c7 commit 3e5d282Copy full SHA for 3e5d282
llvm/test/Transforms/InstCombine/cttz-shift-exact.ll
@@ -0,0 +1,24 @@
1
+; RUN: opt -passes=instcombine -S < %s | FileCheck %s
2
+
3
+declare i32 @llvm.cttz.i32(i32, i1)
4
5
+define i32 @test_cttz_lshr(i32 %x) {
6
+; CHECK-LABEL: @test_cttz_lshr(
7
+; CHECK: call range(i32 0, 33) i32 @llvm.cttz.i32(
8
+; CHECK: lshr exact i32
9
+; CHECK: ret i32
10
+ %cttz = call i32 @llvm.cttz.i32(i32 %x, i1 false)
11
+ %sh = lshr i32 %x, %cttz
12
+ ret i32 %sh
13
+}
14
15
+define i32 @test_cttz_ashr(i32 %x) {
16
+; CHECK-LABEL: @test_cttz_ashr(
17
18
+; CHECK: ashr exact i32
19
20
+ %cttz = call i32 @llvm.cttz.i32(i32 %x, i1 true)
21
+ %sh = ashr i32 %x, %cttz
22
23
24
0 commit comments