mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
MI-Sched: schedule physreg copies.
The register allocator expects minimal physreg live ranges. Schedule physreg copies accordingly. This is slightly tricky when they occur in the middle of the scheduling region. For now, this is handled by rescheduling the copy when its associated instruction is scheduled. Eventually we may instead bundle them, but only if we can preserve the bundles as parallel copies during regalloc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179449 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -262,6 +262,9 @@ void ScheduleDAGInstrs::addPhysRegDataDeps(SUnit *SU, unsigned OperIdx) {
|
||||
if (UseOp < 0)
|
||||
Dep = SDep(SU, SDep::Artificial);
|
||||
else {
|
||||
// Set the hasPhysRegDefs only for physreg defs that have a use within
|
||||
// the scheduling region.
|
||||
SU->hasPhysRegDefs = true;
|
||||
Dep = SDep(SU, SDep::Data, *Alias);
|
||||
RegUse = UseSU->getInstr();
|
||||
Dep.setMinLatency(
|
||||
@@ -318,6 +321,7 @@ void ScheduleDAGInstrs::addPhysRegDeps(SUnit *SU, unsigned OperIdx) {
|
||||
}
|
||||
|
||||
if (!MO.isDef()) {
|
||||
SU->hasPhysRegUses = true;
|
||||
// Either insert a new Reg2SUnits entry with an empty SUnits list, or
|
||||
// retrieve the existing SUnits list for this register's uses.
|
||||
// Push this SUnit on the use list.
|
||||
|
||||
Reference in New Issue
Block a user