mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Reapply r85338.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85514 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0507d8373a
commit
a33ac6a4c1
@ -1861,6 +1861,21 @@ bool SimpleRegisterCoalescing::RangeIsDefinedByCopyFromReg(LiveInterval &li,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// ValueLiveAt - Return true if the LiveRange pointed to by the given
|
||||||
|
/// iterator, or any subsequent range with the same value number,
|
||||||
|
/// is live at the given point.
|
||||||
|
bool SimpleRegisterCoalescing::ValueLiveAt(LiveInterval::iterator LRItr,
|
||||||
|
LiveIndex defPoint) const {
|
||||||
|
for (const VNInfo *valno = LRItr->valno; LRItr->valno == valno; ++LRItr) {
|
||||||
|
if (LRItr->contains(defPoint))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// SimpleJoin - Attempt to joint the specified interval into this one. The
|
/// SimpleJoin - Attempt to joint the specified interval into this one. The
|
||||||
/// caller of this method must guarantee that the RHS only contains a single
|
/// caller of this method must guarantee that the RHS only contains a single
|
||||||
/// value number and that the RHS is not defined by a copy from this
|
/// value number and that the RHS is not defined by a copy from this
|
||||||
@ -1907,7 +1922,7 @@ bool SimpleRegisterCoalescing::SimpleJoin(LiveInterval &LHS, LiveInterval &RHS){
|
|||||||
if (!RangeIsDefinedByCopyFromReg(LHS, LHSIt, RHS.reg))
|
if (!RangeIsDefinedByCopyFromReg(LHS, LHSIt, RHS.reg))
|
||||||
return false; // Nope, bail out.
|
return false; // Nope, bail out.
|
||||||
|
|
||||||
if (LHSIt->contains(RHSIt->valno->def))
|
if (ValueLiveAt(LHSIt, RHSIt->valno->def))
|
||||||
// Here is an interesting situation:
|
// Here is an interesting situation:
|
||||||
// BB1:
|
// BB1:
|
||||||
// vr1025 = copy vr1024
|
// vr1025 = copy vr1024
|
||||||
@ -1945,7 +1960,7 @@ bool SimpleRegisterCoalescing::SimpleJoin(LiveInterval &LHS, LiveInterval &RHS){
|
|||||||
// Otherwise, if this is a copy from the RHS, mark it as being merged
|
// Otherwise, if this is a copy from the RHS, mark it as being merged
|
||||||
// in.
|
// in.
|
||||||
if (RangeIsDefinedByCopyFromReg(LHS, LHSIt, RHS.reg)) {
|
if (RangeIsDefinedByCopyFromReg(LHS, LHSIt, RHS.reg)) {
|
||||||
if (LHSIt->contains(RHSIt->valno->def))
|
if (ValueLiveAt(LHSIt, RHSIt->valno->def))
|
||||||
// Here is an interesting situation:
|
// Here is an interesting situation:
|
||||||
// BB1:
|
// BB1:
|
||||||
// vr1025 = copy vr1024
|
// vr1025 = copy vr1024
|
||||||
|
@ -201,6 +201,11 @@ namespace llvm {
|
|||||||
bool CanJoinInsertSubRegToPhysReg(unsigned DstReg, unsigned SrcReg,
|
bool CanJoinInsertSubRegToPhysReg(unsigned DstReg, unsigned SrcReg,
|
||||||
unsigned SubIdx, unsigned &RealDstReg);
|
unsigned SubIdx, unsigned &RealDstReg);
|
||||||
|
|
||||||
|
/// ValueLiveAt - Return true if the LiveRange pointed to by the given
|
||||||
|
/// iterator, or any subsequent range with the same value number,
|
||||||
|
/// is live at the given point.
|
||||||
|
bool ValueLiveAt(LiveInterval::iterator LRItr, LiveIndex defPoint) const;
|
||||||
|
|
||||||
/// RangeIsDefinedByCopyFromReg - Return true if the specified live range of
|
/// RangeIsDefinedByCopyFromReg - Return true if the specified live range of
|
||||||
/// the specified live interval is defined by a copy from the specified
|
/// the specified live interval is defined by a copy from the specified
|
||||||
/// register.
|
/// register.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user