[llvm-branch-commits] [llvm] CodeGen: Skip main range predecessor lookup in shrinkToUses (PR #243346)

Lukas Sommer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Nov 17 01:31:31 PST 2026


================
@@ -558,16 +558,15 @@ void LiveIntervals::extendSegmentsToUses(LiveRange &Segments,
         continue;
       Tag = ShrinkTag;
       SlotIndex Stop = Indexes->getMBBEndIdx(Pred);
-      if (VNInfo *OldVNI = OldRange.getVNInfoBefore(Stop)) {
+      if (VNInfo *OldVNI =
+              LaneMask.none() ? VNI : OldRange.getVNInfoBefore(Stop)) {
         assert(OldVNI == VNI && "Wrong value out of predecessor");
         (void)OldVNI;
         WorkList.push_back(std::make_pair(Stop, VNI));
       } else {
 #ifndef NDEBUG
         // There was no old VNI. Verify that Stop is jointly dominated
         // by <undef>s for this live range.
-        assert(LaneMask.any() &&
-               "Missing value out of predecessor for main range");
----------------
sommerlukas wrote:

Would it be worth to keep the check for this invariant for debug builds by moving it up?

https://github.com/llvm/llvm-project/pull/243346


More information about the llvm-branch-commits mailing list