[PATCH] D67800: [InstCombine] Fold a shifty implementation of clamp (e.g., clamp255).

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 21 03:07:28 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2689
+                              m_APInt(ShAmt)))) &&
+        *ShAmt == Ty->getScalarSizeInBits() - 1) {
+      Value *NewICmpInst =
----------------
huihuiz wrote:
> lebedev.ri wrote:
> > As per the alive, this isn't needed?
> Shift amount need to be type ScalarSizeInBits - 1, see https://rise4fun.com/Alive/nPP
Err, i actually meant to talk about `C` - it should just be `%X`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67800





More information about the llvm-commits mailing list