[PATCH] D28195: [selectiondag] Mark node created in SoftenFloatRes_FP_EXTEND as Processed.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 31 05:16:53 PST 2016


fhahn created this revision.
fhahn added reviewers: t.p.northover, baldrick, olista01.
fhahn added a subscriber: llvm-commits.
Herald added a subscriber: aemerson.

By calling SoftenFloatResult, a new entry is added to the SoftenedFloats
map, which is then used in PerformExpansiveChecks. PerformExpansiveChecks
will then fail, because the node will not be marked as Processed.

      

Marking the node as Processed here should be OK, because the created
node should be legal already, but I could very well be wrong.

      

There is no test case for this patch, because I do not know how to test
expansive checks, but in combination with https://reviews.llvm.org/D28187 it fixes all ARM
codegen failures with expansive checks.


https://reviews.llvm.org/D28195

Files:
  lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp


Index: lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -458,8 +458,10 @@
   // hard-float FP_EXTEND rather than FP16_TO_FP.
   if (Op.getValueType() == MVT::f16 && N->getValueType(0) != MVT::f32) {
     Op = DAG.getNode(ISD::FP_EXTEND, SDLoc(N), MVT::f32, Op);
-    if (getTypeAction(MVT::f32) == TargetLowering::TypeSoftenFloat)
+    if (getTypeAction(MVT::f32) == TargetLowering::TypeSoftenFloat) {
       SoftenFloatResult(Op.getNode(), 0);
+      Op.getNode()->setNodeId(Processed);
+    }
   }
 
   if (getTypeAction(Op.getValueType()) == TargetLowering::TypePromoteFloat) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28195.82762.patch
Type: text/x-patch
Size: 755 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161231/a148df90/attachment.bin>


More information about the llvm-commits mailing list