[llvm] c9e8e80 - [SelectionDAG][X86] Mutate strictFP nodes to non-strict in DoInstructionSelection when the node is marked Expand rather than when it is not Legal.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 10:41:25 PST 2019


Author: Craig Topper
Date: 2019-11-20T10:36:02-08:00
New Revision: c9e8e808cf8ae563329597b61b0b6b7adcc65b87

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

LOG: [SelectionDAG][X86] Mutate strictFP nodes to non-strict in DoInstructionSelection when the node is marked Expand rather than when it is not Legal.

This allows operations that are marked Custom, but have some type
combinations that are legal to get past this code.

Add custom mutation code to X86's Select function for the nodes
that don't have isel patterns yet.

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 23a035a42e85..2757e1cf015f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1157,7 +1157,7 @@ void SelectionDAGISel::DoInstructionSelection() {
       // selectors.
       if (Node->isStrictFPOpcode() &&
           (TLI->getOperationAction(Node->getOpcode(), Node->getValueType(0))
-           != TargetLowering::Legal))
+           == TargetLowering::Expand))
         Node = CurDAG->mutateStrictFPToFP(Node);
 
       LLVM_DEBUG(dbgs() << "\nISEL: Starting selection on root node: ";

diff  --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
index 298bb7d358ea..a91b23a3ce51 100644
--- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -5220,6 +5220,13 @@ void X86DAGToDAGISel::Select(SDNode *Node) {
     SelectCode(Res.getNode());
     return;
   }
+  case ISD::STRICT_FP_TO_SINT:
+  case ISD::STRICT_FP_TO_UINT:
+  case ISD::STRICT_FP_ROUND:
+    // FIXME: Remove when we have isel patterns for strict versions of these
+    // nodes.
+    CurDAG->mutateStrictFPToFP(Node);
+    break;
   }
 
   SelectCode(Node);


        


More information about the llvm-commits mailing list