diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-09-13 18:05:29 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-09-13 18:05:29 +0000 |
commit | 4484f9917596330c2ba3e64fca636f4f226a9e69 (patch) | |
tree | 9618130c190cf3e5a93fdbbe22a77fd8401ae050 /llvm/lib/CodeGen/SplitKit.cpp | |
parent | 427f42e04a8a1a4284030ea0981d5002b5bb3373 (diff) | |
download | bcm5719-llvm-4484f9917596330c2ba3e64fca636f4f226a9e69.tar.gz bcm5719-llvm-4484f9917596330c2ba3e64fca636f4f226a9e69.zip |
Add SplitEditor::markOverlappedComplement().
This function is used to flag values where the complement interval may
overlap other intervals. Call it from overlapIntv, and use the flag to
fully recompute those live ranges in transferValues().
llvm-svn: 139612
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SplitKit.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp index 4bf3a7aab0c..89e85bd3838 100644 --- a/llvm/lib/CodeGen/SplitKit.cpp +++ b/llvm/lib/CodeGen/SplitKit.cpp @@ -317,6 +317,7 @@ void SplitEditor::reset(LiveRangeEdit &LRE, ComplementSpillMode SM) { Edit = &LRE; SpillMode = SM; OpenIdx = 0; + OverlappedComplement.clear(); RegAssign.clear(); Values.clear(); @@ -391,6 +392,16 @@ void SplitEditor::markComplexMapped(unsigned RegIdx, const VNInfo *ParentVNI) { VNI = 0; } +void SplitEditor::markOverlappedComplement(const VNInfo *ParentVNI) { + if (OverlappedComplement.insert(ParentVNI)) + markComplexMapped(0, ParentVNI); +} + +bool SplitEditor::needsRecompute(unsigned RegIdx, const VNInfo *ParentVNI) { + return (RegIdx == 0 && OverlappedComplement.count(ParentVNI)) || + Edit->didRematerialize(ParentVNI); +} + VNInfo *SplitEditor::defFromParent(unsigned RegIdx, VNInfo *ParentVNI, SlotIndex UseIdx, @@ -575,7 +586,7 @@ void SplitEditor::overlapIntv(SlotIndex Start, SlotIndex End) { // The complement interval will be extended as needed by LRCalc.extend(). if (ParentVNI) - markComplexMapped(0, ParentVNI); + markOverlappedComplement(ParentVNI); DEBUG(dbgs() << " overlapIntv [" << Start << ';' << End << "):"); RegAssign.insert(Start, End, OpenIdx); DEBUG(dump()); @@ -623,7 +634,7 @@ bool SplitEditor::transferValues() { // Skip rematerialized values, we need to use LRCalc.extend() and // extendPHIKillRanges() to completely recompute the live ranges. - if (Edit->didRematerialize(ParentVNI)) { + if (needsRecompute(RegIdx, ParentVNI)) { DEBUG(dbgs() << "(remat)"); Skipped = true; Start = End; |