diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-08-11 20:42:59 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-08-11 20:42:59 +0000 |
commit | 59c8b411e0cd391fc198e4ec23049e2ccbf84a02 (patch) | |
tree | 074f17381f86da6900117fc16655bf7059717137 /llvm/lib/CodeGen/MachineCSE.cpp | |
parent | ef6494f24dcc01be9db78c827bdc320e672a510f (diff) | |
download | llvm-59c8b411e0cd391fc198e4ec23049e2ccbf84a02.zip llvm-59c8b411e0cd391fc198e4ec23049e2ccbf84a02.tar.gz llvm-59c8b411e0cd391fc198e4ec23049e2ccbf84a02.tar.bz2 |
MachineCSE: Hoist isConstantPhysReg out of the loop, it checks for overlaps already.
llvm-svn: 161729
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineCSE.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp index 993975e..896461f 100644 --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -215,11 +215,10 @@ bool MachineCSE::hasLivePhysRegDefUses(const MachineInstr *MI, if (MO.isDef() && (MO.isDead() || isPhysDefTriviallyDead(Reg, I, MBB->end()))) continue; - for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) { - // Reading constant physregs is ok. - if (!MRI->isConstantPhysReg(*AI, *MBB->getParent())) + // Reading constant physregs is ok. + if (!MRI->isConstantPhysReg(Reg, *MBB->getParent())) + for (MCRegAliasIterator AI(Reg, TRI, true); AI.isValid(); ++AI) PhysRefs.insert(*AI); - } if (MO.isDef()) PhysDefs.push_back(Reg); } |