mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-06 02:17:20 +00:00
Reserve space in the ValueNumberInfo vector. This speeds up live interval
analysis 16% on crafty. Wrap long lines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30012 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -879,7 +879,6 @@ static unsigned ComputeUltimateVN(unsigned VN,
|
|||||||
return ThisValNoAssignments[VN] = UltimateVN;
|
return ThisValNoAssignments[VN] = UltimateVN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// JoinIntervals - Attempt to join these two intervals. On failure, this
|
/// JoinIntervals - Attempt to join these two intervals. On failure, this
|
||||||
/// returns false. Otherwise, if one of the intervals being joined is a
|
/// returns false. Otherwise, if one of the intervals being joined is a
|
||||||
/// physreg, this method always canonicalizes LHS to be it. The output
|
/// physreg, this method always canonicalizes LHS to be it. The output
|
||||||
@@ -893,7 +892,8 @@ bool LiveIntervals::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS) {
|
|||||||
SmallVector<std::pair<unsigned,unsigned>, 16> ValueNumberInfo;
|
SmallVector<std::pair<unsigned,unsigned>, 16> ValueNumberInfo;
|
||||||
LHSValNoAssignments.resize(LHS.getNumValNums(), -1);
|
LHSValNoAssignments.resize(LHS.getNumValNums(), -1);
|
||||||
RHSValNoAssignments.resize(RHS.getNumValNums(), -1);
|
RHSValNoAssignments.resize(RHS.getNumValNums(), -1);
|
||||||
|
ValueNumberInfo.reserve(LHS.getNumValNums() + RHS.getNumValNums());
|
||||||
|
|
||||||
// Compute ultimate value numbers for the LHS and RHS values.
|
// Compute ultimate value numbers for the LHS and RHS values.
|
||||||
if (RHS.containsOneValue()) {
|
if (RHS.containsOneValue()) {
|
||||||
// Copies from a liveinterval with a single value are simple to handle and
|
// Copies from a liveinterval with a single value are simple to handle and
|
||||||
@@ -950,8 +950,8 @@ bool LiveIntervals::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS) {
|
|||||||
RHSValNoAssignments[0] = RHSValID;
|
RHSValNoAssignments[0] = RHSValID;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Loop over the value numbers of the LHS, seeing if any are defined from the
|
// Loop over the value numbers of the LHS, seeing if any are defined from
|
||||||
// RHS.
|
// the RHS.
|
||||||
SmallVector<int, 16> LHSValsDefinedFromRHS;
|
SmallVector<int, 16> LHSValsDefinedFromRHS;
|
||||||
LHSValsDefinedFromRHS.resize(LHS.getNumValNums(), -1);
|
LHSValsDefinedFromRHS.resize(LHS.getNumValNums(), -1);
|
||||||
for (unsigned VN = 0, e = LHS.getNumValNums(); VN != e; ++VN) {
|
for (unsigned VN = 0, e = LHS.getNumValNums(); VN != e; ++VN) {
|
||||||
@@ -959,8 +959,8 @@ bool LiveIntervals::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS) {
|
|||||||
if (ValSrcReg == 0) // Src not defined by a copy?
|
if (ValSrcReg == 0) // Src not defined by a copy?
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// DstReg is known to be a register in the LHS interval. If the src is from
|
// DstReg is known to be a register in the LHS interval. If the src is
|
||||||
// the RHS interval, we can use its value #.
|
// from the RHS interval, we can use its value #.
|
||||||
if (rep(ValSrcReg) != RHS.reg)
|
if (rep(ValSrcReg) != RHS.reg)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -969,8 +969,8 @@ bool LiveIntervals::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS) {
|
|||||||
LHSValsDefinedFromRHS[VN] = RHS.getLiveRangeContaining(ValInst-1)->ValId;
|
LHSValsDefinedFromRHS[VN] = RHS.getLiveRangeContaining(ValInst-1)->ValId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop over the value numbers of the RHS, seeing if any are defined from the
|
// Loop over the value numbers of the RHS, seeing if any are defined from
|
||||||
// LHS.
|
// the LHS.
|
||||||
SmallVector<int, 16> RHSValsDefinedFromLHS;
|
SmallVector<int, 16> RHSValsDefinedFromLHS;
|
||||||
RHSValsDefinedFromLHS.resize(RHS.getNumValNums(), -1);
|
RHSValsDefinedFromLHS.resize(RHS.getNumValNums(), -1);
|
||||||
for (unsigned VN = 0, e = RHS.getNumValNums(); VN != e; ++VN) {
|
for (unsigned VN = 0, e = RHS.getNumValNums(); VN != e; ++VN) {
|
||||||
@@ -978,8 +978,8 @@ bool LiveIntervals::JoinIntervals(LiveInterval &LHS, LiveInterval &RHS) {
|
|||||||
if (ValSrcReg == 0) // Src not defined by a copy?
|
if (ValSrcReg == 0) // Src not defined by a copy?
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// DstReg is known to be a register in the RHS interval. If the src is from
|
// DstReg is known to be a register in the RHS interval. If the src is
|
||||||
// the LHS interval, we can use its value #.
|
// from the LHS interval, we can use its value #.
|
||||||
if (rep(ValSrcReg) != LHS.reg)
|
if (rep(ValSrcReg) != LHS.reg)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user