summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitb16081ce8cbcffb99d9359764db2616f71bb2cdb (patch)
tree31d73428597fa838018ad6883598fe0762384459 /llvm/lib/CodeGen/ProcessImplicitDefs.cpp
parent7f45559e86b415ffc86c828de7d283f560e4eabd (diff)
downloadbcm5719-llvm-b16081ce8cbcffb99d9359764db2616f71bb2cdb.tar.gz
bcm5719-llvm-b16081ce8cbcffb99d9359764db2616f71bb2cdb.zip
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. llvm-svn: 136401
Diffstat (limited to 'llvm/lib/CodeGen/ProcessImplicitDefs.cpp')
-rw-r--r--llvm/lib/CodeGen/ProcessImplicitDefs.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
index c04d65637c9..b1d8c976022 100644
--- a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
+++ b/llvm/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;
}
}
OpenPOWER on IntegriCloud