[PATCH] D143373: [InstCombine] fold icmp of the sum of ext bool based on limited range
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 10 11:48:20 PST 2023
spatel added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5892-5893
+ // canonicalize predicate to eq/ne
+ if ((C == 0 && Pred == ICmpInst::ICMP_SLT) ||
+ (C == 1 && Pred == ICmpInst::ICMP_UGT)) {
+ // x s< 0 in [-1, 1] --> x == -1
----------------
Since we are going through these combinations, we should handle these cases that are missed by InstCombine:
https://alive2.llvm.org/ce/z/3m9D9D
If there are other combinations that are not already handled, then let's reduce those too?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143373/new/
https://reviews.llvm.org/D143373
More information about the llvm-commits
mailing list