From 70a0145d7cad8f134f80be536c76a87ed27ea5e0 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 29 Apr 2010 01:23:55 +0000 Subject: [PATCH] Avoid emitting a dbg_value machineinstr that's not going to be inserted into entry block. llvm-svn: 102581 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 2 ++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 254a6543ffd6..cb933d7cdd51 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -3709,6 +3709,8 @@ SelectionDAGBuilder::EmitFuncArgumentDbgValue(const DbgValueInst &DI, if (!Reg) Reg = FuncInfo.ValueMap[V]; + if (!Reg) + return; const TargetInstrInfo *TII = DAG.getTarget().getInstrInfo(); MachineInstrBuilder MIB = BuildMI(MF, getCurDebugLoc(), diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 88245de01304..adb321d929cf 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -222,8 +222,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { for (unsigned i = 0, e = FuncInfo->ArgDbgValues.size(); i != e; ++i) { MachineInstr *MI = FuncInfo->ArgDbgValues[e-i-1]; unsigned Reg = MI->getOperand(0).getReg(); - if (!Reg) - continue; if (TargetRegisterInfo::isPhysicalRegister(Reg)) EntryMBB->insert(EntryMBB->begin(), MI); else {