Avoid iterating every operand of an instruction in StrongPHIElimination, since

we are only interested in the defs when discovering interferences.

This is a 28% speedup running StrongPHIElimination on 403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122596 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Cameron Zwarich 2010-12-28 10:49:33 +00:00
parent 2aea490e16
commit 92f0fcb6df

View File

@ -471,10 +471,9 @@ StrongPHIElimination::SplitInterferencesForBasicBlock(
DenseMap<unsigned, unsigned>& ImmediateDominatingParent) {
for (MachineBasicBlock::iterator BBI = MBB.begin(), BBE = MBB.end();
BBI != BBE; ++BBI) {
for (unsigned i = 0, e = BBI->getNumOperands(); i != e; ++i) {
MachineOperand& MO = BBI->getOperand(i);
if (!MO.isReg() || !MO.isDef())
continue;
for (MachineInstr::const_mop_iterator I = BBI->operands_begin(),
E = BBI->operands_end(); I != E && I->isReg() && I->isDef(); ++I) {
const MachineOperand& MO = *I;
unsigned DestReg = MO.getReg();
if (!DestReg || !TargetRegisterInfo::isVirtualRegister(DestReg))