diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-09-05 21:46:51 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-09-05 21:46:51 +0000 |
commit | f3bb2e65d12857f83b273f4ecab013680310bbbc (patch) | |
tree | 428110b92bd792f4ae8a0e03156223014e3b9efa /lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | 188b5224fd9c8573713665c77f9d2f415bcc4ff1 (diff) |
Use pool allocator for all the VNInfo's to improve memory access locality. This reduces coalescing time on siod Mac OS X PPC by 35%. Also remove the back ptr from VNInfo to LiveInterval and other tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 03e416b260..4d5c0819ad 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -158,7 +158,7 @@ bool SimpleRegisterCoalescing::AdjustCopiesBackFrom(LiveInterval &IntA, LiveInte for (const unsigned *AS = mri_->getSubRegisters(IntB.reg); *AS; ++AS) { LiveInterval &AliasLI = li_->getInterval(*AS); AliasLI.addRange(LiveRange(FillerStart, FillerEnd, - AliasLI.getNextValue(FillerStart, 0))); + AliasLI.getNextValue(FillerStart, 0, li_->getVNInfoAllocator()))); } } @@ -366,7 +366,8 @@ bool SimpleRegisterCoalescing::JoinCopy(MachineInstr *CopyMI, // Update the liveintervals of sub-registers. for (const unsigned *AS = mri_->getSubRegisters(repDstReg); *AS; ++AS) - li_->getInterval(*AS).MergeInClobberRanges(*ResSrcInt); + li_->getInterval(*AS).MergeInClobberRanges(*ResSrcInt, + li_->getVNInfoAllocator()); } else { // Merge use info if the destination is a virtual register. LiveVariables::VarInfo& dVI = lv_->getVarInfo(repDstReg); @@ -564,13 +565,13 @@ bool SimpleRegisterCoalescing::SimpleJoin(LiveInterval &LHS, LiveInterval &RHS) // Okay, now that there is a single LHS value number that we're merging the // RHS into, update the value number info for the LHS to indicate that the // value number is defined where the RHS value number was. - const VNInfo *VNI = RHS.getFirstValNumInfo(); + const VNInfo *VNI = RHS.getValNumInfo(0); LHSValNo->def = VNI->def; LHSValNo->reg = VNI->reg; // Okay, the final step is to loop over the RHS live intervals, adding them to // the LHS. - LHS.addKills(*LHSValNo, VNI->kills); + LHS.addKills(LHSValNo, VNI->kills); LHS.MergeRangesInAsValue(RHS, LHSValNo); LHS.weight += RHS.weight; if (RHS.preference && !LHS.preference) @@ -625,7 +626,7 @@ bool SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, int RHSVal0DefinedFromLHS = -1; int RHSValID = -1; VNInfo *RHSValNoInfo = NULL; - VNInfo *RHSValNoInfo0 = RHS.getFirstValNumInfo(); + VNInfo *RHSValNoInfo0 = RHS.getValNumInfo(0); unsigned RHSSrcReg = RHSValNoInfo0->reg; if ((RHSSrcReg == 0 || rep(RHSSrcReg) != LHS.reg)) { // If RHS is not defined as a copy from the LHS, we can use simpler and @@ -809,8 +810,8 @@ bool SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, E = LHSValsDefinedFromRHS.end(); I != E; ++I) { VNInfo *VNI = I->first; unsigned LHSValID = LHSValNoAssignments[VNI->id]; - LiveInterval::removeKill(*NewVNInfo[LHSValID], VNI->def); - RHS.addKills(*NewVNInfo[LHSValID], VNI->kills); + LiveInterval::removeKill(NewVNInfo[LHSValID], VNI->def); + RHS.addKills(NewVNInfo[LHSValID], VNI->kills); } RHS.join(LHS, &RHSValNoAssignments[0], &LHSValNoAssignments[0], NewVNInfo); @@ -821,8 +822,8 @@ bool SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, E = RHSValsDefinedFromLHS.end(); I != E; ++I) { VNInfo *VNI = I->first; unsigned RHSValID = RHSValNoAssignments[VNI->id]; - LiveInterval::removeKill(*NewVNInfo[RHSValID], VNI->def); - LHS.addKills(*NewVNInfo[RHSValID], VNI->kills); + LiveInterval::removeKill(NewVNInfo[RHSValID], VNI->def); + LHS.addKills(NewVNInfo[RHSValID], VNI->kills); } LHS.join(RHS, &LHSValNoAssignments[0], &RHSValNoAssignments[0], NewVNInfo); |