[SelectionDAG][X86] Mutate strictFP nodes to non-strict in DoInstructionSelection...
authorCraig Topper <craig.topper@intel.com>
Wed, 20 Nov 2019 18:30:27 +0000 (10:30 -0800)
committerCraig Topper <craig.topper@intel.com>
Wed, 20 Nov 2019 18:36:02 +0000 (10:36 -0800)
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.

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

index 23a035a42e85aa7f4f289a9dd603ebbf6e0bbadd..2757e1cf015f3e5ebf276b90df714c233acc481b 100644 (file)
@@ -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: ";
index 298bb7d358ea94e2c73d131f2bd8178963fc923b..a91b23a3ce5121908268544c1bfab8a1862ae7e2 100644 (file)
@@ -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);