From: Chris Lattner Date: Sun, 15 Dec 2002 08:02:51 +0000 (+0000) Subject: Fix borkness with not using MachineBasicBlocks in PHI nodes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=71c83728b4940379ce969297bca99fd16f8e16ac;p=oota-llvm.git 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 --- 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();