aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocSimple.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-15 08:02:51 +0000
committerChris Lattner <sabre@nondot.org>2002-12-15 08:02:51 +0000
commit71c83728b4940379ce969297bca99fd16f8e16ac (patch)
tree9760e44cd05ac2063e01bec844a46447b5aad8b7 /lib/CodeGen/RegAllocSimple.cpp
parent6b993ccfe5449e780c90fa081e139600d4d20754 (diff)
Fix borkness with not using MachineBasicBlocks in PHI nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5035 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocSimple.cpp')
-rw-r--r--lib/CodeGen/RegAllocSimple.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp
index cbe131c81d..c255bdab14 100644
--- a/lib/CodeGen/RegAllocSimple.cpp
+++ b/lib/CodeGen/RegAllocSimple.cpp
@@ -267,18 +267,7 @@ bool RegAllocSimple::runOnMachineFunction(MachineFunction &Fn) {
// Get the MachineBasicBlock equivalent of the BasicBlock that is the
// source path the phi
- BasicBlock *opBB =
- cast<BasicBlock>(MI->getOperand(i).getVRegValue());
- MachineBasicBlock *opBlock = NULL;
- for (MachineFunction::iterator opFi = Fn.begin(), opFe = Fn.end();
- opFi != opFe; ++opFi)
- {
- if (opFi->getBasicBlock() == opBB) {
- opBlock = opFi; break;
- }
- }
- assert(opBlock && "MachineBasicBlock object not found for specified block!");
-
+ MachineBasicBlock *opBlock = MI->getOperand(i).getMachineBasicBlock();
MachineBasicBlock::iterator opI = opBlock->end();
MachineInstr *opMI = *(--opI);
const MachineInstrInfo &MII = TM.getInstrInfo();