summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ProcessImplicitDefs.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-28 21:38:51 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-07-28 21:38:51 +0000
commitf6c690019b7ba9d121e658d16b9d99831df7428f (patch)
tree9a2fa1cfed5dbbd1f600c3e2518dc7d6381f343f /lib/CodeGen/ProcessImplicitDefs.cpp
parent43afb6ff1cf7b040e2d70abb47679e1357a329d5 (diff)
downloadllvm-f6c690019b7ba9d121e658d16b9d99831df7428f.tar.gz
llvm-f6c690019b7ba9d121e658d16b9d99831df7428f.tar.bz2
llvm-f6c690019b7ba9d121e658d16b9d99831df7428f.tar.xz
Handle REG_SEQUENCE with implicitly defined operands.
Code like that would only be produced by bugpoint, but we should still handle it correctly. When a register is defined by a REG_SEQUENCE of undefs, the register itself is undef. Previously, we would create a register with uses but no defs. Fixes part of PR10520. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136401 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ProcessImplicitDefs.cpp')
-rw-r--r--lib/CodeGen/ProcessImplicitDefs.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/ProcessImplicitDefs.cpp b/lib/CodeGen/ProcessImplicitDefs.cpp
index c04d65637c..b1d8c97602 100644
--- a/lib/CodeGen/ProcessImplicitDefs.cpp
+++ b/lib/CodeGen/ProcessImplicitDefs.cpp
@@ -125,8 +125,14 @@ bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &fn) {
LiveVariables::VarInfo& vi = LV->getVarInfo(MO.getReg());
vi.removeKill(MI);
}
+ unsigned Reg = MI->getOperand(0).getReg();
MI->eraseFromParent();
Changed = true;
+
+ // A REG_SEQUENCE may have been expanded into partial definitions.
+ // If this was the last one, mark Reg as implicitly defined.
+ if (TargetRegisterInfo::isVirtualRegister(Reg) && MRI->def_empty(Reg))
+ ImpDefRegs.insert(Reg);
continue;
}
}