diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-09-19 09:51:03 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-09-19 09:51:03 +0000 |
commit | 9827ad39a7a76802f5ec6f08a833d3ff12f74077 (patch) | |
tree | 254dd54f18989232cbf90efebd37d4426d3d2810 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | dad401dbc1773ac867122eca27aaee7690ee7768 (diff) | |
download | bcm5719-llvm-9827ad39a7a76802f5ec6f08a833d3ff12f74077.tar.gz bcm5719-llvm-9827ad39a7a76802f5ec6f08a833d3ff12f74077.zip |
Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.
llvm-svn: 82311
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 26f3fc78afb..df9f29644b1 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -2920,12 +2920,15 @@ ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, F->insert(It, sinkMBB); // Update machine-CFG edges by first adding all successors of the current // block to the new block which will contain the Phi node for the select. - for(MachineBasicBlock::succ_iterator i = BB->succ_begin(), - e = BB->succ_end(); i != e; ++i) - sinkMBB->addSuccessor(*i); + // Also inform sdisel of the edge changes. + for (MachineBasicBlock::succ_iterator I = BB->succ_begin(), + E = BB->succ_end(); I != E; ++I) { + EM->insert(std::make_pair(*I, sinkMBB)); + sinkMBB->addSuccessor(*I); + } // Next, remove all successors of the current block, and add the true // and fallthrough blocks as its successors. - while(!BB->succ_empty()) + while (!BB->succ_empty()) BB->removeSuccessor(BB->succ_begin()); BB->addSuccessor(copy0MBB); BB->addSuccessor(sinkMBB); |