diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-09-01 02:03:17 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-09-01 02:03:17 +0000 |
commit | 343013538f72f2202338f57161c0bd92344ca407 (patch) | |
tree | f69d838f6da2c14e84a2c498617ec76911907122 /lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | 4e9c473c4d9e0e93da67d6a0e20227e5a1e16543 (diff) |
More tweaks to improve compile time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 052573a35c..03e416b260 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -682,8 +682,9 @@ bool SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, assert(RHSValID != -1 && "Didn't find value #?"); RHSValNoAssignments[0] = RHSValID; if (RHSVal0DefinedFromLHS != -1) { - RHSValsDefinedFromLHS[RHSValNoInfo0] = - LHS.getLiveRangeContaining(RHSValNoInfo0->def-1)->valno; + // This path doesn't go through ComputeUltimateVN so just set + // it to anything. + RHSValsDefinedFromLHS[RHSValNoInfo0] = (VNInfo*)1; } } else { // Loop over the value numbers of the LHS, seeing if any are defined from @@ -798,31 +799,32 @@ bool SimpleRegisterCoalescing::JoinIntervals(LiveInterval &LHS, } } - // Update kill info. Some live ranges are extended due to copy coalescing. - for (DenseMap<VNInfo*, VNInfo*>::iterator I = RHSValsDefinedFromLHS.begin(), - 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); - } - - for (DenseMap<VNInfo*, VNInfo*>::iterator I = LHSValsDefinedFromRHS.begin(), - 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); - } - // If we get here, we know that we can coalesce the live ranges. Ask the // intervals to coalesce themselves now. if ((RHS.ranges.size() > LHS.ranges.size() && MRegisterInfo::isVirtualRegister(LHS.reg)) || MRegisterInfo::isPhysicalRegister(RHS.reg)) { + // Update kill info. Some live ranges are extended due to copy coalescing. + for (DenseMap<VNInfo*, VNInfo*>::iterator I = LHSValsDefinedFromRHS.begin(), + 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); + } + RHS.join(LHS, &RHSValNoAssignments[0], &LHSValNoAssignments[0], NewVNInfo); Swapped = true; } else { + // Update kill info. Some live ranges are extended due to copy coalescing. + for (DenseMap<VNInfo*, VNInfo*>::iterator I = RHSValsDefinedFromLHS.begin(), + 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); + } + LHS.join(RHS, &LHSValNoAssignments[0], &RHSValNoAssignments[0], NewVNInfo); Swapped = false; } |