summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2013-07-04 04:32:39 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2013-07-04 04:32:39 +0000
commit3d8560c382f6d422737e57c32737e7379fefa184 (patch)
tree9c31f785d29b57aa6910a1ae83553597e49b0457 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parentbbbb53262a87b2bf861b2c333270b8f50a562321 (diff)
downloadbcm5719-llvm-3d8560c382f6d422737e57c32737e7379fefa184.tar.gz
bcm5719-llvm-3d8560c382f6d422737e57c32737e7379fefa184.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index aa1686fb7d5..e039be759c4 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -76,15 +76,12 @@ STATISTIC(NumFastIselDead, "Number of dead insts removed on failure");
void FastISel::startNewBlock() {
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;
-
- // Advance the emit start point past any EH_LABEL instructions.
- MachineBasicBlock::iterator
- I = FuncInfo.MBB->begin(), E = FuncInfo.MBB->end();
- while (I != E && I->getOpcode() == TargetOpcode::EH_LABEL) {
- EmitStartPt = I;
- ++I;
- }
+ if (!FuncInfo.MBB->empty())
+ EmitStartPt = &FuncInfo.MBB->back();
LastLocalValue = EmitStartPt;
}
OpenPOWER on IntegriCloud