summaryrefslogtreecommitdiff
path: root/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
commitef22e0e0b583e727f01ae70d51a143172eb31814 (patch)
treeb900c43f1dc4b993ac885c3959827733efc9fb62 /lib/CodeGen/SelectionDAG/FastISel.cpp
parentc982e14458ab098dcc08da5a3e8a88f07018dfbd (diff)
downloadllvm-ef22e0e0b583e727f01ae70d51a143172eb31814.tar.gz
llvm-ef22e0e0b583e727f01ae70d51a143172eb31814.tar.bz2
llvm-ef22e0e0b583e727f01ae70d51a143172eb31814.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index aa1686fb7d..e039be759c 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/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;
}