[PATCH] D148413: [InstCombine] Remove requirement on `trunc` in `slt/sgt` case in `foldSelectICmpAndOr`

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 13:06:56 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:676
     C1Log = CmpLHS->getType()->getScalarSizeInBits() - 1;
     NeedAnd = true;
   }
----------------
Unless I'm missing something, we're missing an assignment to the `V` variable in this branch now? Also, do we still need the `NeedAnd`?

We should really just be using decomposeBitTestICmp() and a pow2 check I think, but this code is doing some very weird things I don't fully get.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148413



More information about the llvm-commits mailing list