From f12f9beb04289f3ea1c1e9112609172e0b1b749b Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 19 May 2021 14:21:20 -0400 Subject: [PATCH] [x86] propagate FMF from x86-specific intrinsic nodes to others during combining This is another FMF gap exposed by D90901, but I don't see a way to show the difference in a regression test as with: f66ba4c 6025663 We will see an asm difference if we add a test as part of D90901. --- llvm/lib/Target/X86/X86ISelLowering.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 4b05415..893c7ab 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -48063,6 +48063,8 @@ static SDValue combineFMA(SDNode *N, SelectionDAG &DAG, unsigned NewOpcode = negateFMAOpcode(N->getOpcode(), NegA != NegB, NegC, false); + // Propagate fast-math-flags to new FMA node. + SelectionDAG::FlagInserter FlagsInserter(DAG, Flags); if (IsStrict) { assert(N->getNumOperands() == 4 && "Shouldn't be greater than 4"); return DAG.getNode(NewOpcode, dl, {VT, MVT::Other}, -- 2.7.4