[llvm-branch-commits] [llvm] InstCombine: Handle fsub in SimplifyDemandedFPClass (PR #175852)
Yingwei Zheng via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jan 15 07:57:59 PST 2026
================
@@ -2157,11 +2162,13 @@ Value *InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
}
// With nnan: X + {+/-}Inf --> {+/-}Inf
- if (KnownRHS.isKnownAlways(fcInf | fcNan) &&
- KnownLHS.isKnownNever(fcNan))
+ if (I->getOpcode() == Instruction::FAdd &&
+ KnownRHS.isKnownAlways(fcInf | fcNan) && KnownLHS.isKnownNever(fcNan)) {
return I->getOperand(1);
+ }
// With nnan: {+/-}Inf + X --> {+/-}Inf
+ // With nnan: {+/-}Inf - X --> {+/-}Inf
if (KnownLHS.isKnownAlways(fcInf | fcNan) &&
----------------
dtcxzyw wrote:
ResultNotNan &&
https://github.com/llvm/llvm-project/pull/175852
More information about the llvm-branch-commits
mailing list