[PATCH] D115755: [InstSimplify] Fold logic And to Zero

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 14:16:05 PST 2021


rampitec added inline comments.


================
Comment at: llvm/test/Transforms/InstSimplify/and.ll:187
+
+; ((A | B) ^ A ) & ((A | B) ^ A) --> 0
+
----------------
It shall not be '0'. Comment is misleading.


================
Comment at: llvm/test/Transforms/InstSimplify/and.ll:189
+
+define <2 x i64> @or_xor_commute4(<2 x i64> %x, <2 x i64> %y) {
+; CHECK-LABEL: @or_xor_commute4(
----------------
This is not commute. This is a wrong operand.


================
Comment at: llvm/test/Transforms/InstSimplify/and.ll:191
+; CHECK-LABEL: @or_xor_commute4(
+; CHECK-NEXT:    [[OR:%.*]] = or <2 x i64> [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT:    [[XOR2:%.*]] = xor <2 x i64> [[OR]], [[X]]
----------------
And in fact the test does not catch it. I think 'and' was simply dropped earlier. Maybe a duplicated 'or' will expose it or maybe not.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115755/new/

https://reviews.llvm.org/D115755



More information about the llvm-commits mailing list