summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineSink.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-01-16 22:34:08 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-01-16 22:34:08 +0000
commit86ae07f049fce1bc69d26e7fa22caf3ce45259de (patch)
treee3af25a2e502c20525691355fd8535273fb8df7b /llvm/lib/CodeGen/MachineSink.cpp
parenteff0a40d7e5a440b470f8f16459c8aa1ad8c1345 (diff)
downloadbcm5719-llvm-86ae07f049fce1bc69d26e7fa22caf3ce45259de.tar.gz
bcm5719-llvm-86ae07f049fce1bc69d26e7fa22caf3ce45259de.zip
Extract method for detecting constant unallocatable physregs.
It is safe to move uses of such registers. llvm-svn: 148259
Diffstat (limited to 'llvm/lib/CodeGen/MachineSink.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineSink.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp
index e47360dbba5..817e5cb8195 100644
--- a/llvm/lib/CodeGen/MachineSink.cpp
+++ b/llvm/lib/CodeGen/MachineSink.cpp
@@ -485,21 +485,8 @@ MachineBasicBlock *MachineSinking::FindSuccToSinkTo(MachineInstr *MI,
// If the physreg has no defs anywhere, it's just an ambient register
// and we can freely move its uses. Alternatively, if it's allocatable,
// it could get allocated to something with a def during allocation.
- if (!MRI->def_empty(Reg))
+ if (!MRI->isConstantPhysReg(Reg, *MBB->getParent()))
return NULL;
-
- if (AllocatableSet.test(Reg))
- return NULL;
-
- // Check for a def among the register's aliases too.
- for (const unsigned *Alias = TRI->getAliasSet(Reg); *Alias; ++Alias) {
- unsigned AliasReg = *Alias;
- if (!MRI->def_empty(AliasReg))
- return NULL;
-
- if (AllocatableSet.test(AliasReg))
- return NULL;
- }
} else if (!MO.isDead()) {
// A def that isn't dead. We can't move it.
return NULL;
OpenPOWER on IntegriCloud