summaryrefslogtreecommitdiffstats
path: root/lib/Target/Alpha
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/Alpha
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/Alpha')
-rw-r--r--lib/Target/Alpha/AlphaISelLowering.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/Alpha/AlphaISelLowering.cpp b/lib/Target/Alpha/AlphaISelLowering.cpp
index 1034b61..777ab52 100644
--- a/lib/Target/Alpha/AlphaISelLowering.cpp
+++ b/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);