mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Re-apply bottom-up fast-isel, with fixes. Be very careful to avoid emitting
a DBG_VALUE after a terminator, or emitting any instructions before an EH_LABEL. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107943 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -519,13 +519,13 @@ static void ProcessSourceNode(SDNode *N, SelectionDAG *DAG,
|
||||
return;
|
||||
|
||||
MachineBasicBlock *BB = Emitter.getBlock();
|
||||
if (BB->empty() || BB->back().isPHI()) {
|
||||
if (Emitter.getInsertPos() == BB->begin() || BB->back().isPHI()) {
|
||||
// Did not insert any instruction.
|
||||
Orders.push_back(std::make_pair(Order, (MachineInstr*)0));
|
||||
return;
|
||||
}
|
||||
|
||||
Orders.push_back(std::make_pair(Order, &BB->back()));
|
||||
Orders.push_back(std::make_pair(Order, prior(Emitter.getInsertPos())));
|
||||
if (!N->getHasDebugValue())
|
||||
return;
|
||||
// Opportunistically insert immediate dbg_value uses, i.e. those with source
|
||||
@@ -564,7 +564,7 @@ MachineBasicBlock *ScheduleDAGSDNodes::EmitSchedule() {
|
||||
for (; PDI != PDE; ++PDI) {
|
||||
MachineInstr *DbgMI= Emitter.EmitDbgValue(*PDI, VRBaseMap);
|
||||
if (DbgMI)
|
||||
BB->push_back(DbgMI);
|
||||
BB->insert(InsertPos, DbgMI);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -608,9 +608,7 @@ MachineBasicBlock *ScheduleDAGSDNodes::EmitSchedule() {
|
||||
// Insert all the dbg_values which have not already been inserted in source
|
||||
// order sequence.
|
||||
if (HasDbg) {
|
||||
MachineBasicBlock::iterator BBBegin = BB->empty() ? BB->end() : BB->begin();
|
||||
while (BBBegin != BB->end() && BBBegin->isPHI())
|
||||
++BBBegin;
|
||||
MachineBasicBlock::iterator BBBegin = BB->getFirstNonPHI();
|
||||
|
||||
// Sort the source order instructions and use the order to insert debug
|
||||
// values.
|
||||
@@ -626,7 +624,6 @@ MachineBasicBlock *ScheduleDAGSDNodes::EmitSchedule() {
|
||||
// Insert all SDDbgValue's whose order(s) are before "Order".
|
||||
if (!MI)
|
||||
continue;
|
||||
MachineBasicBlock *MIBB = MI->getParent();
|
||||
#ifndef NDEBUG
|
||||
unsigned LastDIOrder = 0;
|
||||
#endif
|
||||
@@ -646,7 +643,7 @@ MachineBasicBlock *ScheduleDAGSDNodes::EmitSchedule() {
|
||||
BB->insert(BBBegin, DbgMI);
|
||||
else {
|
||||
MachineBasicBlock::iterator Pos = MI;
|
||||
MIBB->insert(llvm::next(Pos), DbgMI);
|
||||
BB->insert(llvm::next(Pos), DbgMI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user