From 71c83728b4940379ce969297bca99fd16f8e16ac Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 15 Dec 2002 08:02:51 +0000 Subject: [PATCH] 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 --- lib/CodeGen/RegAllocSimple.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/CodeGen/RegAllocSimple.cpp b/lib/CodeGen/RegAllocSimple.cpp index cbe131c81d0..c255bdab14b 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(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();