aboutsummaryrefslogtreecommitdiffstats
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
commit5f3a54090af5d61d35de2158542ff76fc9ef053f (patch)
tree724f5ef9adebe214b0b564f1f8153e5d329e0a31 /lib/Target/SystemZ
parent48c3c54ceb1fbdcddac9f11a11163a44efe21f55 (diff)
downloadexternal_llvm-5f3a54090af5d61d35de2158542ff76fc9ef053f.zip
external_llvm-5f3a54090af5d61d35de2158542ff76fc9ef053f.tar.gz
external_llvm-5f3a54090af5d61d35de2158542ff76fc9ef053f.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);