[llvm] [InstCombine] Make fptrunc combine use intersection of fast math flags (PR #118808)
John Brawn via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 07:50:39 PST 2024
================
@@ -1847,15 +1847,16 @@ Instruction *InstCombinerImpl::visitFPTrunc(FPTruncInst &FPT) {
Value *X;
Instruction *Op = dyn_cast<Instruction>(FPT.getOperand(0));
if (Op && Op->hasOneUse()) {
- // FIXME: The FMF should propagate from the fptrunc, not the source op.
IRBuilder<>::FastMathFlagGuard FMFG(Builder);
+ FastMathFlags FMF = FPT.getFastMathFlags();
if (isa<FPMathOperator>(Op))
- Builder.setFastMathFlags(Op->getFastMathFlags());
+ FMF &= Op->getFastMathFlags();
----------------
john-brawn-arm wrote:
Yes, I meant intersection.
https://github.com/llvm/llvm-project/pull/118808
More information about the llvm-commits
mailing list