[llvm] InstCombine: Teach SimplifyDemandedFPClass to infer nnan and ninf on fmul (PR #175854)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 14 07:25:42 PST 2026
================
@@ -2329,7 +2329,18 @@ Value *InstCombinerImpl::SimplifyDemandedUseFPClass(Instruction *I,
Known = KnownFPClass::fmul(KnownLHS, KnownRHS, Mode);
FPClassTest ValidResults = DemandedMask & Known.KnownFPClasses;
- return getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true);
+ if (Constant *SingleVal =
+ getFPClassConstant(VTy, ValidResults, /*IsCanonicalizing=*/true))
+ return SingleVal;
+
+ FastMathFlags InferredFMF =
+ inferFastMathValueFlagsBinOp(FMF, ValidResults, KnownLHS, KnownRHS);
----------------
arsenm wrote:
I'm not sure why the root would matter? This would mean losing noundef as the return attribute on the calling function: https://alive2.llvm.org/ce/z/JK2Hst
https://github.com/llvm/llvm-project/pull/175854
More information about the llvm-commits
mailing list