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.
isKnownNonZero
smax
1 parent 37ca6fa commit 2ff82c2Copy full SHA for 2ff82c2
llvm/test/Transforms/InstSimplify/known-non-zero.ll
@@ -166,3 +166,18 @@ A:
166
B:
167
ret i1 0
168
}
169
+
170
+define i1 @smax_non_zero(i8 %xx, i8 %y) {
171
+; CHECK-LABEL: @smax_non_zero(
172
+; CHECK-NEXT: [[X0:%.*]] = and i8 [[XX:%.*]], 63
173
+; CHECK-NEXT: [[X:%.*]] = add i8 [[X0]], 1
174
+; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.smax.i8(i8 [[X]], i8 [[Y:%.*]])
175
+; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[V]], 0
176
+; CHECK-NEXT: ret i1 [[R]]
177
+;
178
+ %x0 = and i8 %xx, 63
179
+ %x = add i8 %x0, 1
180
+ %v = call i8 @llvm.smax.i8(i8 %x, i8 %y)
181
+ %r = icmp eq i8 %v, 0
182
+ ret i1 %r
183
+}
0 commit comments