[PATCH] D26359: Use LiveRangeCalc to extend live ranges in shrinkToUses

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 18:57:04 PST 2016


MatzeB added a comment.

Reusing more of the LiveRangeCalc code is a good plan. However with this version I am confused as to why there is any custom code in shrinkToUses left anyway. It seems like you create a completely new liverange anyway, copy all the VNI objects instead of reusing them, even dropping all the PHI-VNIs and let LiveRangeCalc recompute them. At that point it would probably be easier to simply drop the recompute the whole LiveInterval.

Can explain why reusing the existing VNI objects is not possible?



================
Comment at: lib/CodeGen/LiveIntervalAnalysis.cpp:338-339
   for (auto VNI : VNIs) {
-    if (VNI->isUnused())
-      continue;
-    SlotIndex Def = VNI->def;
-    LR.addSegment(LiveRange::Segment(Def, Def.getDeadSlot(), VNI));
+    if (!VNI->isUnused() && !VNI->isPHIDef())
+      LR.createDeadDef(VNI->def, VNA);
   }
----------------
Shouldn't you rather stay with the old code that reuses the existing VNInfo objects instead of creating new ones? It's also not clear to me whether the old ones ever get invalidated in this version.


Repository:
  rL LLVM

https://reviews.llvm.org/D26359





More information about the llvm-commits mailing list