[PATCH] D59374: [InstCombine] canonicalize funnel shift constant shift amount to be modulo bitwidth

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 11:27:35 PDT 2019


nikic added a comment.

You might also want to kill this TODO: https://github.com/llvm-mirror/llvm/blob/master/lib/Analysis/InstructionSimplify.cpp#L4920

Technically it's not quite solved because we're not guaranteed canonical IR, but it's probably not worth dealing with this in InstSimplify if we have this in InstCombine.



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2012
       Value *Op0 = II->getArgOperand(0), *Op1 = II->getArgOperand(1);
       unsigned BitWidth = SA->getBitWidth();
       uint64_t ShiftAmt = SA->urem(BitWidth);
----------------
Can also drop this BitWidth.


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

https://reviews.llvm.org/D59374





More information about the llvm-commits mailing list