[llvm-commits] [llvm] r122596 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Cameron Zwarich
zwarich at apple.com
Tue Dec 28 02:49:33 PST 2010
Author: zwarich
Date: Tue Dec 28 04:49:33 2010
New Revision: 122596
URL: http://llvm.org/viewvc/llvm-project?rev=122596&view=rev
Log:
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.
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=122596&r1=122595&r2=122596&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Tue Dec 28 04:49:33 2010
@@ -471,10 +471,9 @@
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))
More information about the llvm-commits
mailing list