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/Alpha/AlphaISelLowering.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/Alpha/AlphaISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/Alpha/AlphaISelLowering.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp index 1034b6103e9..777ab524ada 100644 --- a/llvm/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/llvm/lib/Target/Alpha/AlphaISelLowering.cpp @@ -855,6 +855,11 @@ AlphaTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *llscMBB = F->CreateMachineBasicBlock(LLVM_BB); MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB); + // 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->transferSuccessors(thisMBB); F->insert(It, llscMBB); |