From 235aa5eba7984ba7b526f9b63273549f5a7efc80 Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Wed, 28 Apr 2004 04:34:16 +0000 Subject: [PATCH] In InsertFPRegKills(), use the machine-CFG itself rather than the LLVM CFG when trying to find the successors of BB. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13212 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/InstSelectSimple.cpp | 6 +++--- lib/Target/X86/X86ISelSimple.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Target/X86/InstSelectSimple.cpp b/lib/Target/X86/InstSelectSimple.cpp index 8617f0662cc..508bbc89589 100644 --- a/lib/Target/X86/InstSelectSimple.cpp +++ b/lib/Target/X86/InstSelectSimple.cpp @@ -743,9 +743,9 @@ void ISel::InsertFPRegKills() { // If we haven't found an FP register use or def in this basic block, check // to see if any of our successors has an FP PHI node, which will cause a // copy to be inserted into this block. - for (succ_const_iterator SI = succ_begin(BB->getBasicBlock()), - E = succ_end(BB->getBasicBlock()); SI != E; ++SI) { - MachineBasicBlock *SBB = MBBMap[*SI]; + for (MachineBasicBlock::const_succ_iterator SI = BB->succ_begin(), + SE = BB->succ_end(); SI != SE; ++SI) { + MachineBasicBlock *SBB = *SI; for (MachineBasicBlock::iterator I = SBB->begin(); I != SBB->end() && I->getOpcode() == X86::PHI; ++I) { if (RegMap.getRegClass(I->getOperand(0).getReg())->getSize() == 10) diff --git a/lib/Target/X86/X86ISelSimple.cpp b/lib/Target/X86/X86ISelSimple.cpp index 8617f0662cc..508bbc89589 100644 --- a/lib/Target/X86/X86ISelSimple.cpp +++ b/lib/Target/X86/X86ISelSimple.cpp @@ -743,9 +743,9 @@ void ISel::InsertFPRegKills() { // If we haven't found an FP register use or def in this basic block, check // to see if any of our successors has an FP PHI node, which will cause a // copy to be inserted into this block. - for (succ_const_iterator SI = succ_begin(BB->getBasicBlock()), - E = succ_end(BB->getBasicBlock()); SI != E; ++SI) { - MachineBasicBlock *SBB = MBBMap[*SI]; + for (MachineBasicBlock::const_succ_iterator SI = BB->succ_begin(), + SE = BB->succ_end(); SI != SE; ++SI) { + MachineBasicBlock *SBB = *SI; for (MachineBasicBlock::iterator I = SBB->begin(); I != SBB->end() && I->getOpcode() == X86::PHI; ++I) { if (RegMap.getRegClass(I->getOperand(0).getReg())->getSize() == 10) -- 2.34.1