summaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-08-11 20:42:59 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-08-11 20:42:59 +0000
commit5fa2d458af8522a0fc3c6c93227d8cb3c0dc2862 (patch)
treeaa4d820ef2ffd29a70aa594e33410d9062f293b8 /lib/CodeGen/MachineCSE.cpp
parentcfc0ad6e48fcbb5d9d7d97307e5b5df6bba53a97 (diff)
downloadllvm-5fa2d458af8522a0fc3c6c93227d8cb3c0dc2862.tar.gz
llvm-5fa2d458af8522a0fc3c6c93227d8cb3c0dc2862.tar.bz2
llvm-5fa2d458af8522a0fc3c6c93227d8cb3c0dc2862.tar.xz
MachineCSE: Hoist isConstantPhysReg out of the loop, it checks for overlaps already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineCSE.cpp')
-rw-r--r--lib/CodeGen/MachineCSE.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/MachineCSE.cpp b/lib/CodeGen/MachineCSE.cpp
index 993975ef0e..896461fd19 100644
--- a/lib/CodeGen/MachineCSE.cpp
+++ b/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);
}