[PATCH] D64275: [InstCombine] Generalize InstCombiner::foldAndOrOfICmpsOfAndWithPow2().
Huihui Zhang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 11 16:09:43 PDT 2019
huihuiz added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:926-930
+ auto B2 = Builder.CreateLShr(
+ ConstantInt::get(
+ B->getType(),
+ APInt::getSignMask(B->getType()->getScalarSizeInBits())),
+ B);
----------------
lebedev.ri wrote:
> 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?
We are not supposed to create for both sides, this will be handled by early exit.
lambda helper probably better.
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