[llvm] r185616 - FastISel can only apend to basic blocks.
Jakob Stoklund Olesen
stoklund at 2pi.dk
Wed Jul 3 21:32:40 PDT 2013
Author: stoklund
Date: Wed Jul 3 23:32:39 2013
New Revision: 185616
URL: http://llvm.org/viewvc/llvm-project?rev=185616&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=185616&r1=185615&r2=185616&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Jul 3 23:32:39 2013
@@ -76,15 +76,12 @@ STATISTIC(NumFastIselDead, "Number of de
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;
}
More information about the llvm-commits
mailing list