diff options
| author | Dan Gohman <gohman@apple.com> | 2010-07-07 21:18:22 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-07-07 21:18:22 +0000 |
| commit | 25d5c1b4f8f0869657fbf9fed1334451faa5984a (patch) | |
| tree | 4921684bbd530de70013cd395a30c2632264ab2f /llvm/lib | |
| parent | 41a3c9a5f8eee24f8d611f36ee5278d97f02c515 (diff) | |
| download | bcm5719-llvm-25d5c1b4f8f0869657fbf9fed1334451faa5984a.tar.gz bcm5719-llvm-25d5c1b4f8f0869657fbf9fed1334451faa5984a.zip | |
Not all custom inserters create new basic blocks. If the inserter
didn't create a new block, don't reset the insert position.
llvm-svn: 107813
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index f36620c3edf..5f93e2fcb2e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -732,8 +732,11 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned, if (II.usesCustomInsertionHook()) { // Insert this instruction into the basic block using a target // specific inserter which may returns a new basic block. - MBB = TLI->EmitInstrWithCustomInserter(MI, MBB); - InsertPos = MBB->end(); + MachineBasicBlock *NewMBB = TLI->EmitInstrWithCustomInserter(MI, MBB); + if (NewMBB != MBB) { + MBB = NewMBB; + InsertPos = NewMBB->end(); + } return; } |

