[llvm] [InstCombine] Fold fcmp ogt (x - y), 0 into fcmp ogt x, y #85245 (PR #85506)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 10 04:35:09 PDT 2024
================
@@ -8037,6 +8037,44 @@ Instruction *InstCombinerImpl::visitFCmpInst(FCmpInst &I) {
if (Instruction *NV = FoldOpIntoSelect(I, cast<SelectInst>(LHSI)))
return NV;
break;
+ case Instruction::FSub:
+ switch (Pred) {
+ default:
+ break;
+ case FCmpInst::FCMP_UGT:
+ case FCmpInst::FCMP_ULT:
+ case FCmpInst::FCMP_UNE:
+ case FCmpInst::FCMP_OEQ:
+ case FCmpInst::FCMP_OGE:
+ case FCmpInst::FCMP_OLE:
+ // fsub x, y --> isnnan(x, y) && isninf(x, y)
----------------
SahilPatidar wrote:
I apologize for my poor commenting skills.
https://github.com/llvm/llvm-project/pull/85506
More information about the llvm-commits
mailing list