Skip to content

Commit

Permalink
LiveIntervals: add removeRegUnit
Browse files Browse the repository at this point in the history
Summary:
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.

Reviewers: MatzeB, arsenm

Subscribers: llvm-commits, MatzeB

Differential Revision: https://reviews.llvm.org/D22801

llvm-svn: 278920
  • Loading branch information
nhaehnle committed Aug 17, 2016
1 parent 6b3f82d commit 1cdd6ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
Expand Up @@ -392,6 +392,13 @@ extern cl::opt<bool> UseSegmentSetForPhysRegs;
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.
Expand Down

0 comments on commit 1cdd6ca

Please sign in to comment.