[PATCH] D112634: [InstCombine] canonicalize icmp with trunc op into mask and cmp, part 2

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 11:49:44 PST 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4635
+      Value *And = Builder.CreateAnd(X, MaskC);
+      return new ICmpInst(ICmpInst::ICMP_NE, And, MaskC);
+    }
----------------
I'm guessing we prefer inequality check over relational? https://alive2.llvm.org/ce/z/9mn4Tx


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4639
+
+  if (Pred == ICmpInst::ICMP_UGT) {
+    // If C is a low-bit-mask (C+1 is a power-of-2):
----------------
Are these supposed to be in this patch? I'm not seeing alive2 links in the description for them.


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

https://reviews.llvm.org/D112634



More information about the llvm-commits mailing list