diff options
author | dim <dim@FreeBSD.org> | 2013-07-08 17:57:11 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-07-08 17:57:11 +0000 |
commit | c5bbe954c0e89cd657179842dc5df922c86ef8ba (patch) | |
tree | 65f97260435bdd98a926889ac35dc071c3dfbad1 /contrib/llvm/lib | |
parent | 6a98a29d2971fc8059b201218429959d7f0ab15b (diff) | |
download | FreeBSD-src-c5bbe954c0e89cd657179842dc5df922c86ef8ba.zip FreeBSD-src-c5bbe954c0e89cd657179842dc5df922c86ef8ba.tar.gz |
Pull in r185616 from llvm trunk:
FastISel can only append 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.
I missed this change in r252720; without it, certain compilation flags
can cause exception labels to not be generated, but still referenced,
leading to link errors.
Reported by: zeising
MFC after: 3 days
Diffstat (limited to 'contrib/llvm/lib')
-rw-r--r-- | contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 288499a..e096a23 100644 --- a/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -75,15 +75,12 @@ STATISTIC(NumFastIselDead, "Number of dead insts removed on failure"); void FastISel::startNewBlock() { LocalValueMap.clear(); + // Instructions are appended 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; } |