summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegisterScavenging.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-05-02 20:06:28 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-05-02 20:06:28 +0000
commit2048e4ab7fb4ed45bae2159bae600ddf610303b1 (patch)
tree76f4673e8dab9d6c4c8bab27e8f88a41461f169e /lib/CodeGen/RegisterScavenging.cpp
parent8ce864e32458c6ca8b109bd7d3f002b8df34b6d3 (diff)
downloadllvm-2048e4ab7fb4ed45bae2159bae600ddf610303b1.tar.gz
llvm-2048e4ab7fb4ed45bae2159bae600ddf610303b1.tar.bz2
llvm-2048e4ab7fb4ed45bae2159bae600ddf610303b1.tar.xz
Only ignore <undef> use operands, keep the <def,undef> ops.
Def operands may also have an <undef> flag, but that just means that a sub-register redef doesn't actually read the super-register. For physical registers, it has no meaning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegisterScavenging.cpp')
-rw-r--r--lib/CodeGen/RegisterScavenging.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/RegisterScavenging.cpp b/lib/CodeGen/RegisterScavenging.cpp
index ebfe533838..e2c25aba02 100644
--- a/lib/CodeGen/RegisterScavenging.cpp
+++ b/lib/CodeGen/RegisterScavenging.cpp
@@ -154,13 +154,16 @@ void RegScavenger::forward() {
BitVector DeadRegs(NumPhysRegs);
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
const MachineOperand &MO = MI->getOperand(i);
- if (!MO.isReg() || MO.isUndef())
+ if (!MO.isReg())
continue;
unsigned Reg = MO.getReg();
if (!Reg || isReserved(Reg))
continue;
if (MO.isUse()) {
+ // Ignore undef uses.
+ if (MO.isUndef())
+ continue;
// Two-address operands implicitly kill.
if (!isPred && (MO.isKill() || MI->isRegTiedToDefOperand(i)))
addRegWithSubRegs(KillRegs, Reg);