forked from OSchip/llvm-project
misched: try (not too hard) to place debug values where they belong
llvm-svn: 155458
This commit is contained in:
parent
cc45a28320
commit
c3ea00565f
|
@ -359,6 +359,8 @@ protected:
|
||||||
void releaseSuccessors(SUnit *SU);
|
void releaseSuccessors(SUnit *SU);
|
||||||
void releasePred(SUnit *SU, SDep *PredEdge);
|
void releasePred(SUnit *SU, SDep *PredEdge);
|
||||||
void releasePredecessors(SUnit *SU);
|
void releasePredecessors(SUnit *SU);
|
||||||
|
|
||||||
|
void placeDebugValues();
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
@ -526,6 +528,29 @@ void ScheduleDAGMI::schedule() {
|
||||||
SU->isScheduled = true;
|
SU->isScheduled = true;
|
||||||
}
|
}
|
||||||
assert(CurrentTop == CurrentBottom && "Nonempty unscheduled zone.");
|
assert(CurrentTop == CurrentBottom && "Nonempty unscheduled zone.");
|
||||||
|
|
||||||
|
placeDebugValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Reinsert any remaining debug_values, just like the PostRA scheduler.
|
||||||
|
void ScheduleDAGMI::placeDebugValues() {
|
||||||
|
// If first instruction was a DBG_VALUE then put it back.
|
||||||
|
if (FirstDbgValue) {
|
||||||
|
BB->splice(RegionBegin, BB, FirstDbgValue);
|
||||||
|
RegionBegin = FirstDbgValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (std::vector<std::pair<MachineInstr *, MachineInstr *> >::iterator
|
||||||
|
DI = DbgValues.end(), DE = DbgValues.begin(); DI != DE; --DI) {
|
||||||
|
std::pair<MachineInstr *, MachineInstr *> P = *prior(DI);
|
||||||
|
MachineInstr *DbgValue = P.first;
|
||||||
|
MachineBasicBlock::iterator OrigPrevMI = P.second;
|
||||||
|
BB->splice(++OrigPrevMI, BB, DbgValue);
|
||||||
|
if (OrigPrevMI == llvm::prior(RegionEnd))
|
||||||
|
RegionEnd = DbgValue;
|
||||||
|
}
|
||||||
|
DbgValues.clear();
|
||||||
|
FirstDbgValue = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
Loading…
Reference in New Issue