[PATCH] D26359: Don't assert on missing value from predecessor

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 11:36:28 PST 2016


kparzysz created this revision.
kparzysz added a reviewer: MatzeB.
kparzysz added a subscriber: llvm-commits.
kparzysz set the repository for this revision to rL LLVM.

The function extendSegmentsToUses will assert if it encounters a value that is live-in to a block BB, but in some predecessor that value is either not live-on-exit, or differs from the expected one.
Since uses need to be jointly dominated by the union of defs and undefs, it may happen that the exit from one or more predecessors will be jointly dominated only by undefs. In such case, the value will not be live-on-exit from that block.

Limit the assertion to cases when the value does exist in a predecessor, but is not what is expected.


Repository:
  rL LLVM

https://reviews.llvm.org/D26359

Files:
  lib/CodeGen/LiveIntervalAnalysis.cpp


Index: lib/CodeGen/LiveIntervalAnalysis.cpp
===================================================================
--- lib/CodeGen/LiveIntervalAnalysis.cpp
+++ lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -388,9 +388,11 @@
       if (!LiveOut.insert(Pred).second)
         continue;
       SlotIndex Stop = Indexes.getMBBEndIdx(Pred);
-      assert(OldRange.getVNInfoBefore(Stop) == VNI &&
-             "Wrong value out of predecessor");
-      WorkList.push_back(std::make_pair(Stop, VNI));
+      // The exit from a predecessor may be jointly dominated by undefs.
+      if (VNInfo *PVNI = OldRange.getVNInfoBefore(Stop)) {
+        assert(PVNI == VNI && "Wrong value out of predecessor");
+        WorkList.push_back(std::make_pair(Stop, VNI));
+      }
     }
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26359.77070.patch
Type: text/x-patch
Size: 765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161107/3e0414d0/attachment.bin>


More information about the llvm-commits mailing list