[llvm-commits] [llvm] r122635 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Cameron Zwarich
zwarich at apple.com
Wed Dec 29 16:42:23 PST 2010
Author: zwarich
Date: Wed Dec 29 18:42:23 2010
New Revision: 122635
URL: http://llvm.org/viewvc/llvm-project?rev=122635&view=rev
Log:
Use getVRegDef() instead of def_iterator. This leads to fewer defs being added
with 2-address instructions, for about a 3.5% speedup of StrongPHIElimination on
403.gcc.
Modified:
llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=122635&r1=122634&r2=122635&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Wed Dec 29 18:42:23 2010
@@ -233,10 +233,9 @@
addReg(SrcReg);
unionRegs(DestReg, SrcReg);
- for (MachineRegisterInfo::def_iterator DI = MRI->def_begin(SrcReg),
- DE = MRI->def_end(); DI != DE; ++DI) {
- PHISrcDefs[DI->getParent()].push_back(&*DI);
- }
+ MachineInstr* DefMI = MRI->getVRegDef(SrcReg);
+ if (DefMI)
+ PHISrcDefs[DefMI->getParent()].push_back(DefMI);
}
}
}
More information about the llvm-commits
mailing list