[PATCH] D133919: [InstCombine] Fold ((x?1:4)&(y?1:4))==0 to x^y
Marc Auberer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 27 13:13:34 PDT 2022
marcauberer marked an inline comment as done.
marcauberer added inline comments.
================
Comment at: llvm/test/Transforms/InstCombine/select_and_icmpne.ll:68
; CHECK-LABEL: @select_and_icmpne_i8_negative_other_pred(
-; CHECK-NEXT: [[S1:%.*]] = select i1 [[X:%.*]], i8 1, i8 8
-; CHECK-NEXT: [[S2:%.*]] = select i1 [[Y:%.*]], i8 1, i8 8
-; CHECK-NEXT: [[AND:%.*]] = and i8 [[S1]], [[S2]]
-; CHECK-NEXT: [[ICMP:%.*]] = icmp ne i8 [[AND]], 0
-; CHECK-NEXT: ret i1 [[ICMP]]
+; CHECK-NEXT: [[TMP1:%.*]] = xor i1 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: ret i1 [[TMP1]]
----------------
That result might be confusing, but as you see on the original test result, the 'ugt' predicate gets transformed to 'ne' and then the transformation can take effect.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133919/new/
https://reviews.llvm.org/D133919
More information about the llvm-commits
mailing list