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/SystemZ | |
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/SystemZ')
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZISelLowering.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp index 4ea94740559..07e0d830580 100644 --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -810,6 +810,10 @@ SystemZTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI, BuildMI(BB, dl, TII.getBrCond(CC)).addMBB(copy1MBB); F->insert(I, copy0MBB); F->insert(I, copy1MBB); + // Inform sdisel of the edge changes. + for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(), + SE = BB->succ_end(); SI != SE; ++SI) + EM->insert(std::make_pair(*SI, copy1MBB)); // Update machine-CFG edges by transferring all successors of the current // block to the new block which will contain the Phi node for the select. copy1MBB->transferSuccessors(BB); |