Skip to content

Commit 9b2537e

Browse files
jmorsevedantk
authored andcommitted
Revert "[DebugInfo] Remove some users of DBG_VALUEs IsIndirect field"
This reverts commit ed29dba. I'm backing out D68945, which as the discussion for D73526 shows, doesn't seem to handle the -O0 path through the codegen backend correctly. I'll reland the patch when a fix is worked out, apologies for all the churn. The two parent commits are part of this revert too. Conflicts: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp llvm/test/DebugInfo/X86/dbg-addr-dse.ll SelectionDAGBuilder conflict is due to a nearby change in e39e2b4 that's technically unrelated. dbg-addr-dse.ll conflicted because 41206b6 (legitimately) changes the order of two lines. There are further modifications to dbg-value-func-arg.ll: it landed after the patch being reverted, and I've converted indirection to be represented by the isIndirect field rather than DW_OP_deref. (cherry picked from commit 6531a78)
1 parent 236fd70 commit 9b2537e

23 files changed

+97
-120
lines changed

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID,
13851385
if (!V) {
13861386
// Currently the optimizer can produce this; insert an undef to
13871387
// help debugging. Probably the optimizer should not do this.
1388-
MIRBuilder.buildDirectDbgValue(0, DI.getVariable(), DI.getExpression());
1388+
MIRBuilder.buildIndirectDbgValue(0, DI.getVariable(), DI.getExpression());
13891389
} else if (const auto *CI = dyn_cast<Constant>(V)) {
13901390
MIRBuilder.buildConstDbgValue(*CI, DI.getVariable(), DI.getExpression());
13911391
} else {

llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,9 @@ MachineIRBuilder::buildIndirectDbgValue(Register Reg, const MDNode *Variable,
107107
assert(
108108
cast<DILocalVariable>(Variable)->isValidLocationForIntrinsic(getDL()) &&
109109
"Expected inlined-at fields to agree");
110-
// DBG_VALUE insts now carry IR-level indirection in their DIExpression
111-
// rather than encoding it in the instruction itself.
112-
const DIExpression *DIExpr = cast<DIExpression>(Expr);
113-
DIExpr = DIExpression::append(DIExpr, {dwarf::DW_OP_deref});
114110
return insertInstr(BuildMI(getMF(), getDL(),
115111
getTII().get(TargetOpcode::DBG_VALUE),
116-
/*IsIndirect*/ false, Reg, Variable, DIExpr));
112+
/*IsIndirect*/ true, Reg, Variable, Expr));
117113
}
118114

119115
MachineInstrBuilder MachineIRBuilder::buildFIDbgValue(int FI,
@@ -124,15 +120,11 @@ MachineInstrBuilder MachineIRBuilder::buildFIDbgValue(int FI,
124120
assert(
125121
cast<DILocalVariable>(Variable)->isValidLocationForIntrinsic(getDL()) &&
126122
"Expected inlined-at fields to agree");
127-
// DBG_VALUE insts now carry IR-level indirection in their DIExpression
128-
// rather than encoding it in the instruction itself.
129-
const DIExpression *DIExpr = cast<DIExpression>(Expr);
130-
DIExpr = DIExpression::append(DIExpr, {dwarf::DW_OP_deref});
131123
return buildInstr(TargetOpcode::DBG_VALUE)
132124
.addFrameIndex(FI)
133-
.addReg(0)
125+
.addImm(0)
134126
.addMetadata(Variable)
135-
.addMetadata(DIExpr);
127+
.addMetadata(Expr);
136128
}
137129

138130
MachineInstrBuilder MachineIRBuilder::buildConstDbgValue(const Constant &C,
@@ -156,7 +148,7 @@ MachineInstrBuilder MachineIRBuilder::buildConstDbgValue(const Constant &C,
156148
MIB.addReg(0U);
157149
}
158150

159-
return MIB.addReg(0).addMetadata(Variable).addMetadata(Expr);
151+
return MIB.addImm(0).addMetadata(Variable).addMetadata(Expr);
160152
}
161153

162154
MachineInstrBuilder MachineIRBuilder::buildDbgLabel(const MDNode *Label) {

llvm/lib/CodeGen/LiveDebugVariables.cpp

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,27 +100,28 @@ enum : unsigned { UndefLocNo = ~0U };
100100
/// usage of the location.
101101
class DbgValueLocation {
102102
public:
103-
DbgValueLocation(unsigned LocNo)
104-
: LocNo(LocNo) {
103+
DbgValueLocation(unsigned LocNo, bool WasIndirect)
104+
: LocNo(LocNo), WasIndirect(WasIndirect) {
105105
static_assert(sizeof(*this) == sizeof(unsigned), "bad bitfield packing");
106106
assert(locNo() == LocNo && "location truncation");
107107
}
108108

109-
DbgValueLocation() : LocNo(0) {}
109+
DbgValueLocation() : LocNo(0), WasIndirect(0) {}
110110

111111
unsigned locNo() const {
112112
// Fix up the undef location number, which gets truncated.
113113
return LocNo == INT_MAX ? UndefLocNo : LocNo;
114114
}
115+
bool wasIndirect() const { return WasIndirect; }
115116
bool isUndef() const { return locNo() == UndefLocNo; }
116117

117118
DbgValueLocation changeLocNo(unsigned NewLocNo) const {
118-
return DbgValueLocation(NewLocNo);
119+
return DbgValueLocation(NewLocNo, WasIndirect);
119120
}
120121

121122
friend inline bool operator==(const DbgValueLocation &LHS,
122123
const DbgValueLocation &RHS) {
123-
return LHS.LocNo == RHS.LocNo;
124+
return LHS.LocNo == RHS.LocNo && LHS.WasIndirect == RHS.WasIndirect;
124125
}
125126

126127
friend inline bool operator!=(const DbgValueLocation &LHS,
@@ -129,7 +130,8 @@ class DbgValueLocation {
129130
}
130131

131132
private:
132-
unsigned LocNo;
133+
unsigned LocNo : 31;
134+
unsigned WasIndirect : 1;
133135
};
134136

135137
/// Map of where a user value is live, and its location.
@@ -283,8 +285,8 @@ class UserValue {
283285
void mapVirtRegs(LDVImpl *LDV);
284286

285287
/// Add a definition point to this value.
286-
void addDef(SlotIndex Idx, const MachineOperand &LocMO) {
287-
DbgValueLocation Loc(getLocationNo(LocMO));
288+
void addDef(SlotIndex Idx, const MachineOperand &LocMO, bool IsIndirect) {
289+
DbgValueLocation Loc(getLocationNo(LocMO), IsIndirect);
288290
// Add a singular (Idx,Idx) -> Loc mapping.
289291
LocMap::iterator I = locInts.find(Idx);
290292
if (!I.valid() || I.start() != Idx)
@@ -319,10 +321,11 @@ class UserValue {
319321
///
320322
/// \param LI Scan for copies of the value in LI->reg.
321323
/// \param LocNo Location number of LI->reg.
324+
/// \param WasIndirect Indicates if the original use of LI->reg was indirect
322325
/// \param Kills Points where the range of LocNo could be extended.
323326
/// \param [in,out] NewDefs Append (Idx, LocNo) of inserted defs here.
324327
void addDefsFromCopies(
325-
LiveInterval *LI, unsigned LocNo,
328+
LiveInterval *LI, unsigned LocNo, bool WasIndirect,
326329
const SmallVectorImpl<SlotIndex> &Kills,
327330
SmallVectorImpl<std::pair<SlotIndex, DbgValueLocation>> &NewDefs,
328331
MachineRegisterInfo &MRI, LiveIntervals &LIS);
@@ -542,6 +545,8 @@ void UserValue::print(raw_ostream &OS, const TargetRegisterInfo *TRI) {
542545
OS << "undef";
543546
else {
544547
OS << I.value().locNo();
548+
if (I.value().wasIndirect())
549+
OS << " ind";
545550
}
546551
}
547552
for (unsigned i = 0, e = locations.size(); i != e; ++i) {
@@ -650,18 +655,19 @@ bool LDVImpl::handleDebugValue(MachineInstr &MI, SlotIndex Idx) {
650655
}
651656

652657
// Get or create the UserValue for (variable,offset) here.
653-
assert(!MI.getOperand(1).isImm() && "DBG_VALUE with indirect flag before "
654-
"LiveDebugVariables");
658+
bool IsIndirect = MI.getOperand(1).isImm();
659+
if (IsIndirect)
660+
assert(MI.getOperand(1).getImm() == 0 && "DBG_VALUE with nonzero offset");
655661
const DILocalVariable *Var = MI.getDebugVariable();
656662
const DIExpression *Expr = MI.getDebugExpression();
657663
UserValue *UV =
658664
getUserValue(Var, Expr, MI.getDebugLoc());
659665
if (!Discard)
660-
UV->addDef(Idx, MI.getOperand(0));
666+
UV->addDef(Idx, MI.getOperand(0), IsIndirect);
661667
else {
662668
MachineOperand MO = MachineOperand::CreateReg(0U, false);
663669
MO.setIsDebug();
664-
UV->addDef(Idx, MO);
670+
UV->addDef(Idx, MO, false);
665671
}
666672
return true;
667673
}
@@ -769,7 +775,7 @@ void UserValue::extendDef(SlotIndex Idx, DbgValueLocation Loc, LiveRange *LR,
769775
}
770776

771777
void UserValue::addDefsFromCopies(
772-
LiveInterval *LI, unsigned LocNo,
778+
LiveInterval *LI, unsigned LocNo, bool WasIndirect,
773779
const SmallVectorImpl<SlotIndex> &Kills,
774780
SmallVectorImpl<std::pair<SlotIndex, DbgValueLocation>> &NewDefs,
775781
MachineRegisterInfo &MRI, LiveIntervals &LIS) {
@@ -833,7 +839,7 @@ void UserValue::addDefsFromCopies(
833839
MachineInstr *CopyMI = LIS.getInstructionFromIndex(DstVNI->def);
834840
assert(CopyMI && CopyMI->isCopy() && "Bad copy value");
835841
unsigned LocNo = getLocationNo(CopyMI->getOperand(0));
836-
DbgValueLocation NewLoc(LocNo);
842+
DbgValueLocation NewLoc(LocNo, WasIndirect);
837843
I.insert(Idx, Idx.getNextSlot(), NewLoc);
838844
NewDefs.push_back(std::make_pair(Idx, NewLoc));
839845
break;
@@ -881,7 +887,8 @@ void UserValue::computeIntervals(MachineRegisterInfo &MRI,
881887
// sub-register in that regclass). For now, simply skip handling copies if
882888
// a sub-register is involved.
883889
if (LI && !LocMO.getSubReg())
884-
addDefsFromCopies(LI, Loc.locNo(), Kills, Defs, MRI, LIS);
890+
addDefsFromCopies(LI, Loc.locNo(), Loc.wasIndirect(), Kills, Defs, MRI,
891+
LIS);
885892
continue;
886893
}
887894

@@ -1323,14 +1330,21 @@ void UserValue::insertDebugValue(MachineBasicBlock *MBB, SlotIndex StartIdx,
13231330
// that the original virtual register was a pointer. Also, add the stack slot
13241331
// offset for the spilled register to the expression.
13251332
const DIExpression *Expr = Expression;
1326-
if (Spilled)
1327-
Expr = DIExpression::prepend(Expr, DIExpression::ApplyOffset, SpillOffset);
1333+
uint8_t DIExprFlags = DIExpression::ApplyOffset;
1334+
bool IsIndirect = Loc.wasIndirect();
1335+
if (Spilled) {
1336+
if (IsIndirect)
1337+
DIExprFlags |= DIExpression::DerefAfter;
1338+
Expr =
1339+
DIExpression::prepend(Expr, DIExprFlags, SpillOffset);
1340+
IsIndirect = true;
1341+
}
13281342

13291343
assert((!Spilled || MO.isFI()) && "a spilled location must be a frame index");
13301344

13311345
do {
13321346
BuildMI(*MBB, I, getDebugLoc(), TII.get(TargetOpcode::DBG_VALUE),
1333-
Spilled, MO, Variable, Expr);
1347+
IsIndirect, MO, Variable, Expr);
13341348

13351349
// Continue and insert DBG_VALUES after every redefinition of register
13361350
// associated with the debug value within the range

llvm/lib/CodeGen/SelectionDAG/FastISel.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,11 +1393,9 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) {
13931393
"Expected inlined-at fields to agree");
13941394
// A dbg.declare describes the address of a source variable, so lower it
13951395
// into an indirect DBG_VALUE.
1396-
auto *Expr = DI->getExpression();
1397-
Expr = DIExpression::append(Expr, {dwarf::DW_OP_deref});
13981396
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
1399-
TII.get(TargetOpcode::DBG_VALUE), /*IsIndirect*/ false,
1400-
*Op, DI->getVariable(), Expr);
1397+
TII.get(TargetOpcode::DBG_VALUE), /*IsIndirect*/ true,
1398+
*Op, DI->getVariable(), DI->getExpression());
14011399
} else {
14021400
// We can't yet handle anything else here because it would require
14031401
// generating code, thus altering codegen because of debug info.
@@ -1421,19 +1419,19 @@ bool FastISel::selectIntrinsicCall(const IntrinsicInst *II) {
14211419
if (CI->getBitWidth() > 64)
14221420
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II)
14231421
.addCImm(CI)
1424-
.addReg(0U)
1422+
.addImm(0U)
14251423
.addMetadata(DI->getVariable())
14261424
.addMetadata(DI->getExpression());
14271425
else
14281426
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II)
14291427
.addImm(CI->getZExtValue())
1430-
.addReg(0U)
1428+
.addImm(0U)
14311429
.addMetadata(DI->getVariable())
14321430
.addMetadata(DI->getExpression());
14331431
} else if (const auto *CF = dyn_cast<ConstantFP>(V)) {
14341432
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II)
14351433
.addFPImm(CF)
1436-
.addReg(0U)
1434+
.addImm(0U)
14371435
.addMetadata(DI->getVariable())
14381436
.addMetadata(DI->getExpression());
14391437
} else if (unsigned Reg = lookUpRegForValue(V)) {

llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ MachineInstr *
677677
InstrEmitter::EmitDbgValue(SDDbgValue *SD,
678678
DenseMap<SDValue, unsigned> &VRBaseMap) {
679679
MDNode *Var = SD->getVariable();
680-
const DIExpression *Expr = SD->getExpression();
680+
MDNode *Expr = SD->getExpression();
681681
DebugLoc DL = SD->getDebugLoc();
682682
assert(cast<DILocalVariable>(Var)->isValidLocationForIntrinsic(DL) &&
683683
"Expected inlined-at fields to agree");
@@ -701,11 +701,12 @@ InstrEmitter::EmitDbgValue(SDDbgValue *SD,
701701
// EmitTargetCodeForFrameDebugValue is responsible for allocation.
702702
auto FrameMI = BuildMI(*MF, DL, TII->get(TargetOpcode::DBG_VALUE))
703703
.addFrameIndex(SD->getFrameIx());
704-
705704
if (SD->isIndirect())
706-
Expr = DIExpression::append(Expr, {dwarf::DW_OP_deref});
707-
708-
FrameMI.addReg(0);
705+
// Push [fi + 0] onto the DIExpression stack.
706+
FrameMI.addImm(0);
707+
else
708+
// Push fi onto the DIExpression stack.
709+
FrameMI.addReg(0);
709710
return FrameMI.addMetadata(Var).addMetadata(Expr);
710711
}
711712
// Otherwise, we're going to create an instruction here.
@@ -751,9 +752,9 @@ InstrEmitter::EmitDbgValue(SDDbgValue *SD,
751752

752753
// Indirect addressing is indicated by an Imm as the second parameter.
753754
if (SD->isIndirect())
754-
Expr = DIExpression::append(Expr, {dwarf::DW_OP_deref});
755-
756-
MIB.addReg(0U, RegState::Debug);
755+
MIB.addImm(0U);
756+
else
757+
MIB.addReg(0U, RegState::Debug);
757758

758759
MIB.addMetadata(Var);
759760
MIB.addMetadata(Expr);

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5636,7 +5636,7 @@ bool SelectionDAGBuilder::EmitFuncArgumentDbgValue(
56365636
}
56375637
assert(!IsDbgDeclare && "DbgDeclare operand is not in memory?");
56385638
FuncInfo.ArgDbgValues.push_back(
5639-
BuildMI(MF, DL, TII->get(TargetOpcode::DBG_VALUE), false,
5639+
BuildMI(MF, DL, TII->get(TargetOpcode::DBG_VALUE), IsDbgDeclare,
56405640
RegAndSize.first, Variable, *FragmentExpr));
56415641
}
56425642
};
@@ -5669,10 +5669,8 @@ bool SelectionDAGBuilder::EmitFuncArgumentDbgValue(
56695669
assert(Variable->isValidLocationForIntrinsic(DL) &&
56705670
"Expected inlined-at fields to agree");
56715671
IsIndirect = (Op->isReg()) ? IsIndirect : true;
5672-
if (IsIndirect)
5673-
Expr = DIExpression::append(Expr, {dwarf::DW_OP_deref});
56745672
FuncInfo.ArgDbgValues.push_back(
5675-
BuildMI(MF, DL, TII->get(TargetOpcode::DBG_VALUE), false,
5673+
BuildMI(MF, DL, TII->get(TargetOpcode::DBG_VALUE), IsIndirect,
56765674
*Op, Variable, Expr));
56775675

56785676
return true;

llvm/test/CodeGen/AArch64/GlobalISel/debug-cpp.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ target triple = "aarch64-unknown-linux-gnu"
1818
%struct.NTCopy = type { i32 }
1919

2020
; CHECK-LABEL: name: _Z3foo6NTCopy
21-
; CHECK: DBG_VALUE %{{[0-9]+}}(p0), $noreg, !23, !DIExpression(DW_OP_deref), debug-location !24
21+
; CHECK: DBG_VALUE %{{[0-9]+}}(p0), 0, !23, !DIExpression(), debug-location !24
2222
; Function Attrs: noinline nounwind optnone
2323
define dso_local i32 @_Z3foo6NTCopy(%struct.NTCopy* %o) #0 !dbg !7 {
2424
entry:

llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ entry:
1515
}
1616

1717
; CHECK-LABEL: name: debug_declare_vla
18-
; CHECK: DBG_VALUE %{{[0-9]+}}(p0), $noreg, !14, !DIExpression(DW_OP_deref), debug-location !15
18+
; CHECK: DBG_VALUE %{{[0-9]+}}(p0), 0, !14, !DIExpression(), debug-location !15
1919
define void @debug_declare_vla(i32 %in) #0 !dbg !13 {
2020
entry:
2121
%vla.addr = alloca i32, i32 %in
@@ -32,11 +32,11 @@ define void @debug_value(i32 %in) #0 !dbg !16 {
3232
store i32 %in, i32* %addr
3333
; CHECK: DBG_VALUE %1(p0), $noreg, !17, !DIExpression(DW_OP_deref), debug-location !18
3434
call void @llvm.dbg.value(metadata i32* %addr, i64 0, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
35-
; CHECK: DBG_VALUE 123, $noreg, !17, !DIExpression(), debug-location !18
35+
; CHECK: DBG_VALUE 123, 0, !17, !DIExpression(), debug-location !18
3636
call void @llvm.dbg.value(metadata i32 123, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
37-
; CHECK: DBG_VALUE float 1.000000e+00, $noreg, !17, !DIExpression(), debug-location !18
37+
; CHECK: DBG_VALUE float 1.000000e+00, 0, !17, !DIExpression(), debug-location !18
3838
call void @llvm.dbg.value(metadata float 1.000000e+00, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
39-
; CHECK: DBG_VALUE $noreg, $noreg, !17, !DIExpression(), debug-location !18
39+
; CHECK: DBG_VALUE $noreg, 0, !17, !DIExpression(), debug-location !18
4040
call void @llvm.dbg.value(metadata i32* null, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
4141
ret void
4242
}

llvm/test/CodeGen/ARM/debug-info-arg.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ define void @foo(%struct.tag_s* nocapture %this, %struct.tag_s* %c, i64 %x, i64
1111
tail call void @llvm.dbg.value(metadata %struct.tag_s* %c, metadata !13, metadata !DIExpression()), !dbg !21
1212
tail call void @llvm.dbg.value(metadata i64 %x, metadata !14, metadata !DIExpression()), !dbg !22
1313
tail call void @llvm.dbg.value(metadata i64 %y, metadata !17, metadata !DIExpression()), !dbg !23
14-
;CHECK: @DEBUG_VALUE: foo:y <- [DW_OP_plus_uconst 8, DW_OP_deref] $r7
14+
;CHECK: @DEBUG_VALUE: foo:y <- [DW_OP_plus_uconst 8] [$r7+0]
1515
tail call void @llvm.dbg.value(metadata %struct.tag_s* %ptr1, metadata !18, metadata !DIExpression()), !dbg !24
1616
tail call void @llvm.dbg.value(metadata %struct.tag_s* %ptr2, metadata !19, metadata !DIExpression()), !dbg !25
1717
%1 = icmp eq %struct.tag_s* %c, null, !dbg !26

llvm/test/CodeGen/PowerPC/debuginfo-stackarg.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ define i64 @foo(i64 %bar1, i64 %bar2, i64 %bar3, i64 %bar4, i64 %bar5) local_unn
3434
; We expect to find a DBG_VALUE refering to the metadata id for bar5, using the lowest
3535
; of the two fixed stack offsets found earlier.
3636
; CHECK-LABEL: body:
37-
; CHECK: DBG_VALUE $r1, $noreg, !17, !DIExpression(DW_OP_plus_uconst, 8, DW_OP_deref)
37+
; CHECK: DBG_VALUE $r1, 0, !17, !DIExpression(DW_OP_plus_uconst, 8)
3838
entry:
3939
tail call void @llvm.dbg.value(metadata i64 %bar1, metadata !13, metadata !DIExpression()), !dbg !18
4040
tail call void @llvm.dbg.value(metadata i64 %bar2, metadata !14, metadata !DIExpression()), !dbg !19

llvm/test/CodeGen/X86/dbg-value-func-arg.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ target triple = "i386-unknown-unknown"
3030

3131
; Function Attrs: norecurse nounwind readnone
3232
define dso_local %struct.bar* @func1(%struct.bar* readnone returned %0, i32 %1, i32 %2, i32* nocapture readnone %3) local_unnamed_addr #0 !dbg !8 {
33-
; CHECK-DAG: DBG_VALUE %fixed-stack.1, $noreg, {{.*}}, !DIExpression(DW_OP_deref, DW_OP_LLVM_fragment, 0, 32),
34-
; CHECK-DAG: DBG_VALUE %fixed-stack.0, $noreg, {{.*}}, !DIExpression(DW_OP_deref, DW_OP_LLVM_fragment, 32, 32),
35-
; CHECK-DAG: DBG_VALUE %fixed-stack.3, $noreg, {{.*}}, !DIExpression(DW_OP_deref),
36-
; CHECK-DAG: DBG_VALUE %fixed-stack.2, $noreg, {{.*}}, !DIExpression(DW_OP_deref),
37-
; CHECK-DAG: DBG_VALUE %fixed-stack.3, $noreg, {{.*}}, !DIExpression(DW_OP_plus_uconst, 144, DW_OP_deref, DW_OP_stack_value),
38-
; CHECK-DAG: DBG_VALUE %fixed-stack.3, $noreg, {{.*}}, !DIExpression(DW_OP_plus_uconst, 144, DW_OP_deref, DW_OP_stack_value, DW_OP_LLVM_fragment, 32, 32),
33+
; CHECK-DAG: DBG_VALUE %fixed-stack.1, 0, {{.*}}, !DIExpression(DW_OP_LLVM_fragment, 0, 32),
34+
; CHECK-DAG: DBG_VALUE %fixed-stack.0, 0, {{.*}}, !DIExpression(DW_OP_LLVM_fragment, 32, 32),
35+
; CHECK-DAG: DBG_VALUE %fixed-stack.3, 0, {{.*}}, !DIExpression(),
36+
; CHECK-DAG: DBG_VALUE %fixed-stack.2, 0, {{.*}}, !DIExpression(),
37+
; CHECK-DAG: DBG_VALUE %fixed-stack.3, 0, {{.*}}, !DIExpression(DW_OP_plus_uconst, 144, DW_OP_stack_value),
38+
; CHECK-DAG: DBG_VALUE %fixed-stack.3, 0, {{.*}}, !DIExpression(DW_OP_plus_uconst, 144, DW_OP_stack_value, DW_OP_LLVM_fragment, 32, 32),
3939

4040
call void @llvm.dbg.value(metadata i32 %2, metadata !24, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !26
4141
call void @llvm.dbg.value(metadata i32* %3, metadata !24, metadata !DIExpression(DW_OP_LLVM_fragment, 32, 32)), !dbg !26

llvm/test/DebugInfo/ARM/PR16736.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; RUN: llc -filetype=obj < %s \
33
; RUN: | llvm-dwarfdump -debug-info - | FileCheck %s --check-prefix=DWARF
44
;
5-
; CHECK: @DEBUG_VALUE: h:x <- [DW_OP_plus_uconst {{.*}}, DW_OP_deref] $r{{.*}}
5+
; CHECK: @DEBUG_VALUE: h:x <- [DW_OP_plus_uconst {{.*}}] [$r{{.*}}+0]
66
; DWARF: DW_TAG_formal_parameter
77
; DWARF: DW_AT_location
88
; DWARF-NEXT: DW_OP_reg0 R0

llvm/test/DebugInfo/ARM/float-stack-arg.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
define arm_aapcscc float @fn1(i32 %p1, i32 %p2, i32 %p3, i32 %p4, float returned %p5) #0 !dbg !7 {
2121
; CHECK-LABEL: bb.0.entry:
22-
; CHECK-NEXT: DBG_VALUE %fixed-stack.0, $noreg, ![[P5]], !DIExpression(DW_OP_deref)
22+
; CHECK-NEXT: DBG_VALUE %fixed-stack.0, 0, ![[P5]]
2323
entry:
2424
call void @llvm.dbg.value(metadata float %p5, metadata !17, metadata !DIExpression()), !dbg !18
2525
ret float %p5, !dbg !19

0 commit comments

Comments
 (0)