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

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 14:48:28 PDT 2023


goldstein.w.n marked an inline comment as done.
goldstein.w.n added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/select-with-bitwise-ops.ll:772
   ret i8 %select
 }
 
----------------
nikic wrote:
> Can you add a multi-use variant of this test? I think the reason why this code is checking for the trunc is that it replaces a one-use trunc with an and, which preserves the number of uses. If we drop the check, we'll have to take NeedsAnd into account when counting uses.
Good point. Added `NeedAnd` to muiltiuse check.


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