[PATCH] D64275: [InstCombine] Generalize InstCombiner::foldAndOrOfICmpsOfAndWithPow2().

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 14:44:15 PDT 2019


lebedev.ri added a comment.

Hm, not that ugly; this is still correct?



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:926-930
+      auto B2 = Builder.CreateLShr(
+          ConstantInt::get(
+              B->getType(),
+              APInt::getSignMask(B->getType()->getScalarSizeInBits())),
+          B);
----------------
Can we end up needing to create this shift on both sides?
If yes, then can you make this a lambda helper?
If not, create it once and `std::swap()` into proper variable?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64275





More information about the llvm-commits mailing list