FastISel can only apend to basic blocks.

Compute the insertion point from the end of the basic block instead of
skipping labels from the front.

This caused failures in landing pads when live-in copies where inserted
before instruction selection.

llvm-svn: 185616
This commit is contained in:
Jakob Stoklund Olesen 2013-07-04 04:32:39 +00:00
parent bbbb53262a
commit 3d8560c382
1 changed files with 5 additions and 8 deletions

View File

@ -76,15 +76,12 @@ STATISTIC(NumFastIselDead, "Number of dead insts removed on failure");
void FastISel::startNewBlock() { void FastISel::startNewBlock() {
LocalValueMap.clear(); LocalValueMap.clear();
// Instructions are append to FuncInfo.MBB. If the basic block already
// contains labels or copies, use the last instruction as the last local
// value.
EmitStartPt = 0; EmitStartPt = 0;
if (!FuncInfo.MBB->empty())
// Advance the emit start point past any EH_LABEL instructions. EmitStartPt = &FuncInfo.MBB->back();
MachineBasicBlock::iterator
I = FuncInfo.MBB->begin(), E = FuncInfo.MBB->end();
while (I != E && I->getOpcode() == TargetOpcode::EH_LABEL) {
EmitStartPt = I;
++I;
}
LastLocalValue = EmitStartPt; LastLocalValue = EmitStartPt;
} }