[llvm] [InstCombine] Optimize redundant floating point comparisons in `or` inst (PR #158097)
Hongyu Chen via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 13 01:51:57 PDT 2025
================
@@ -1850,6 +1850,26 @@ static Value *simplifyAndOrOfFCmps(const SimplifyQuery &Q, FCmpInst *LHS,
: ConstantInt::getBool(LHS->getType(), !IsAnd);
}
+ Value *V0;
+ const APFloat *V0Op1, *V1Op1;
----------------
XChy wrote:
```suggestion
const APFloat *V0Op1, *V1Op1;
// V0 < C1 || V0 < C2 -> V0 < max(C1, C2)
// V0 > C1 || V0 > C2 -> V0 > min(C1, C2)
```
https://github.com/llvm/llvm-project/pull/158097
More information about the llvm-commits
mailing list