[PATCH] D29265: [legalize-types] Remove stale entries from SoftenedFloats.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 29 14:53:18 PST 2017


fhahn created this revision.

When replacing a SDValue, we should remove the replaced value from
SoftenedFloats (and possibly the other maps as well?).

      

When we revisit a Node because it needs analyzing again, we have to
remove all result values from SoftenedFloats (and possibly other maps?).

      

This fixes the fp128 test failures with expensive checks for X86.

      

I think we probably should also remove the values from the other maps
(PromotedIntegers and so on), let me know what you think.


https://reviews.llvm.org/D29265

Files:
  lib/CodeGen/SelectionDAG/LegalizeTypes.cpp


Index: lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
+++ lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
@@ -331,6 +331,12 @@
     // to the worklist etc.
     if (NeedsReanalyzing) {
       assert(N->getNodeId() == ReadyToProcess && "Node ID recalculated?");
+
+      // Remove any result values from SoftenedFloats as N will be revisited
+      // again.
+      for (unsigned i = 0, NumResults = N->getNumValues(); i < NumResults; ++i)
+        SoftenedFloats.erase(SDValue(N, i));
+
       N->setNodeId(NewNode);
       // Recompute the NodeId and correct processed operands, adding the node to
       // the worklist if ready.
@@ -749,6 +755,8 @@
     // new uses of From due to CSE. If this happens, replace the new uses of
     // From with To.
   } while (!From.use_empty());
+
+  SoftenedFloats.erase(From);
 }
 
 void DAGTypeLegalizer::SetPromotedInteger(SDValue Op, SDValue Result) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29265.86227.patch
Type: text/x-patch
Size: 1001 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170129/6d9d9455/attachment.bin>


More information about the llvm-commits mailing list