[PATCH] D135541: [TargetLowering][RISCV][X86] Support even divisors in expandDIVREMByConstant.

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 15:02:31 PDT 2022


jrtc27 added a comment.

Maybe when TrailingZeros >= HBitWidth?



================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7327
   APInt Mod = APInt::getSignedMinValue(BitWidth + 1);
   APInt MulFactor = Divisor.zext(BitWidth + 1);
   MulFactor = MulFactor.multiplicativeInverse(Mod);
----------------
Should this not be using the original divisor (whether by shifting back by TrailingZeros or making a copy you use elsewhere instead of doing an lshrInPlace)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135541



More information about the llvm-commits mailing list