summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocFast.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-08 23:44:01 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-08-08 23:44:01 +0000
commit4e6966266a6dbbd560e11f68e6a5ff3fd35c130d (patch)
treef56d95d767b673b4c3d739fa3e1607ee8b359ac7 /lib/CodeGen/RegAllocFast.cpp
parent12864689d199209a3a5046f4570d92a252da7420 (diff)
downloadllvm-4e6966266a6dbbd560e11f68e6a5ff3fd35c130d.tar.gz
llvm-4e6966266a6dbbd560e11f68e6a5ff3fd35c130d.tar.bz2
llvm-4e6966266a6dbbd560e11f68e6a5ff3fd35c130d.tar.xz
Don't use getNextOperandForReg() in RAFast.
That particular optimization was probably premature anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocFast.cpp')
-rw-r--r--lib/CodeGen/RegAllocFast.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/CodeGen/RegAllocFast.cpp b/lib/CodeGen/RegAllocFast.cpp
index 8325f20e41..6b3a48eefd 100644
--- a/lib/CodeGen/RegAllocFast.cpp
+++ b/lib/CodeGen/RegAllocFast.cpp
@@ -201,20 +201,16 @@ int RAFast::getStackSpaceFor(unsigned VirtReg, const TargetRegisterClass *RC) {
/// its virtual register, and it is guaranteed to be a block-local register.
///
bool RAFast::isLastUseOfLocalReg(MachineOperand &MO) {
- // Check for non-debug uses or defs following MO.
- // This is the most likely way to fail - fast path it.
- MachineOperand *Next = &MO;
- while ((Next = Next->getNextOperandForReg()))
- if (!Next->isDebug())
- return false;
-
// If the register has ever been spilled or reloaded, we conservatively assume
// it is a global register used in multiple blocks.
if (StackSlotForVirtReg[MO.getReg()] != -1)
return false;
// Check that the use/def chain has exactly one operand - MO.
- return &MRI->reg_nodbg_begin(MO.getReg()).getOperand() == &MO;
+ MachineRegisterInfo::reg_nodbg_iterator I = MRI->reg_nodbg_begin(MO.getReg());
+ if (&I.getOperand() != &MO)
+ return false;
+ return ++I == MRI->reg_nodbg_end();
}
/// addKillFlag - Set kill flags on last use of a virtual register.