summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LowerSubregs.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-08-05 01:57:22 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-08-05 01:57:22 +0000
commit637636735695b8f941af7c72c894b7647c61b04a (patch)
tree68d9aa346ff136b80529f42cca0ade1270f793bc /llvm/lib/CodeGen/LowerSubregs.cpp
parentdf720462772e8482b871fa6dbe125a33e9b0e0b8 (diff)
downloadbcm5719-llvm-637636735695b8f941af7c72c894b7647c61b04a.tar.gz
bcm5719-llvm-637636735695b8f941af7c72c894b7647c61b04a.zip
One more place where subreg lowering forgot to transfer undefness.
llvm-svn: 78144
Diffstat (limited to 'llvm/lib/CodeGen/LowerSubregs.cpp')
-rw-r--r--llvm/lib/CodeGen/LowerSubregs.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LowerSubregs.cpp b/llvm/lib/CodeGen/LowerSubregs.cpp
index e9e60a00f0e..358aa16c486 100644
--- a/llvm/lib/CodeGen/LowerSubregs.cpp
+++ b/llvm/lib/CodeGen/LowerSubregs.cpp
@@ -242,9 +242,12 @@ bool LowerSubregsInstructionPass::LowerInsert(MachineInstr *MI) {
// No need to insert an identity copy instruction. If the SrcReg was
// <undef>, we need to make sure it is alive by inserting an IMPLICIT_DEF
if (MI->getOperand(1).isUndef() && !MI->getOperand(0).isDead()) {
- BuildMI(*MBB, MI, MI->getDebugLoc(),
- TII.get(TargetInstrInfo::IMPLICIT_DEF), DstReg)
- .addReg(InsReg, RegState::ImplicitKill);
+ MachineInstrBuilder MIB = BuildMI(*MBB, MI, MI->getDebugLoc(),
+ TII.get(TargetInstrInfo::IMPLICIT_DEF), DstReg);
+ if (MI->getOperand(2).isUndef())
+ MIB.addReg(InsReg, RegState::Implicit | RegState::Undef);
+ else
+ MIB.addReg(InsReg, RegState::ImplicitKill);
} else {
DOUT << "subreg: eliminated!\n";
MBB->erase(MI);
OpenPOWER on IntegriCloud