[llvm] f12f9be - [x86] propagate FMF from x86-specific intrinsic nodes to others during combining

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed May 19 11:25:16 PDT 2021


Author: Sanjay Patel
Date: 2021-05-19T14:25:09-04:00
New Revision: f12f9beb04289f3ea1c1e9112609172e0b1b749b

URL: https://github.com/llvm/llvm-project/commit/f12f9beb04289f3ea1c1e9112609172e0b1b749b
DIFF: https://github.com/llvm/llvm-project/commit/f12f9beb04289f3ea1c1e9112609172e0b1b749b.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 4b05415df61d..893c7ab20782 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},


        


More information about the llvm-commits mailing list