[PATCH] D48364: [DAG] Don't map a TableId to itself in the ReplacedValues map

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 06:39:48 PDT 2018


bjope added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:578
   if (I != ReplacedValues.end()) {
+    assert(Id != I->second && "Id is mapped to itself.");
     // Use path compression to speed up future lookups if values get multiply
----------------
Maybe an alternative solution could be to allow mapping of a value to itself in ReplacedValues, and then we could simply return Id here when Id==I->second.


================
Comment at: lib/CodeGen/SelectionDAG/LegalizeTypes.cpp:658
+      ReplacedValues[FromId] = ToId;
     DAG.ReplaceAllUsesOfValueWith(From, To);
 
----------------
I think we still need to do this replacement even if FromId == ToId, since From.getNode() != To.getNode(), right?


Repository:
  rL LLVM

https://reviews.llvm.org/D48364





More information about the llvm-commits mailing list