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 fee2953 commit 2a18217Copy full SHA for 2a18217
llvm/test/Transforms/InstSimplify/and-or-implied-cond.ll
@@ -323,3 +323,18 @@ define i1 @and_icmp_implies_poison(i32 %x) {
323
%and = and i1 %cmp1, %cmp2
324
ret i1 %and
325
}
326
+
327
+define i1 @and_is_constant(ptr %arg, ptr %arg2) {
328
+; CHECK-LABEL: @and_is_constant(
329
+; CHECK-NEXT: [[ICMP:%.*]] = icmp eq ptr [[ARG:%.*]], [[ARG2:%.*]]
330
+; CHECK-NEXT: [[CALL:%.*]] = call i1 @llvm.is.constant.i1(i1 [[ICMP]])
331
+; CHECK-NEXT: [[AND:%.*]] = and i1 [[CALL]], [[ICMP]]
332
+; CHECK-NEXT: ret i1 [[AND]]
333
+;
334
+ %icmp = icmp eq ptr %arg, %arg2
335
+ %call = call i1 @llvm.is.constant.i1(i1 %icmp)
336
+ %and = and i1 %call, %icmp
337
+ ret i1 %and
338
+}
339
340
+declare i1 @llvm.is.constant.i1(i1)
0 commit comments