[PATCH] D22801: LiveIntervals: add removeRegUnit

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 26 04:10:29 PDT 2016


nhaehnle created this revision.
nhaehnle added reviewers: MatzeB, arsenm.
nhaehnle added a subscriber: llvm-commits.
Herald added a subscriber: MatzeB.

See D22198 for the motivation: We have a pass that uses LiveIntervals anyway,
and there is now a requirement to track a physical register that is not
usually tracked at this point of the compilation. The pass also introduces
instructions that affect this physical register, but we want to preserve
LiveIntervals.

Rather than add brittle and rarely exercised code to keep the tracking of
the physical register intact, we want to just remove the corresponding
LiveRange -- it didn't exist before anyway, and subsequent passes don't
expect it to be there.

https://reviews.llvm.org/D22801

Files:
  include/llvm/CodeGen/LiveIntervalAnalysis.h

Index: include/llvm/CodeGen/LiveIntervalAnalysis.h
===================================================================
--- include/llvm/CodeGen/LiveIntervalAnalysis.h
+++ include/llvm/CodeGen/LiveIntervalAnalysis.h
@@ -392,6 +392,13 @@
       return RegUnitRanges[Unit];
     }
 
+    /// removeRegUnit - Remove computed live range for Unit. Subsequent uses
+    /// should rely on on-demand recomputation.
+    void removeRegUnit(unsigned Unit) {
+      delete RegUnitRanges[Unit];
+      RegUnitRanges[Unit] = nullptr;
+    }
+
     /// Remove value numbers and related live segments starting at position
     /// @p Pos that are part of any liverange of physical register @p Reg or one
     /// of its subregisters.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22801.65491.patch
Type: text/x-patch
Size: 719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160726/ebac9d6c/attachment.bin>


More information about the llvm-commits mailing list