summaryrefslogtreecommitdiffstats
path: root/lib/Target/SystemZ
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-09-19 09:51:03 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-09-19 09:51:03 +0000
commitce31910eae5bd4896fa6c27798e7b26885691d3b (patch)
tree724f5ef9adebe214b0b564f1f8153e5d329e0a31 /lib/Target/SystemZ
parent83d63919bd990ce00f62e18114504b9e4a5cb35e (diff)
downloadexternal_llvm-ce31910eae5bd4896fa6c27798e7b26885691d3b.zip
external_llvm-ce31910eae5bd4896fa6c27798e7b26885691d3b.tar.gz
external_llvm-ce31910eae5bd4896fa6c27798e7b26885691d3b.tar.bz2
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82311 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ')
-rw-r--r--lib/Target/SystemZ/SystemZISelLowering.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/SystemZ/SystemZISelLowering.cpp b/lib/Target/SystemZ/SystemZISelLowering.cpp
index 4ea9474..07e0d83 100644
--- a/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/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);