From 57fcd3454a5c3285fe7959e14601b8c307ed03b6 Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Wed, 25 Apr 2018 18:58:06 +0000 Subject: [PATCH] [MIR] Add support for debug metadata for fixed stack objects Debug var, expr and loc were only supported for non-fixed stack objects. This patch adds the following fields to the "fixedStack:" entries, and renames the ones from "stack:" to: * debug-info-variable * debug-info-expression * debug-info-location Differential Revision: https://reviews.llvm.org/D46032 llvm-svn: 330859 --- llvm/include/llvm/CodeGen/MIRYamlMapping.h | 19 +++++++--- llvm/include/llvm/CodeGen/MachineFunction.h | 7 ++-- llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 11 +++--- llvm/lib/CodeGen/MIRPrinter.cpp | 34 +++++++++++------- .../AArch64/GlobalISel/arm64-irtranslator.ll | 6 ++-- .../test/CodeGen/AArch64/GlobalISel/debug-insts.ll | 2 +- .../GlobalISel/fp128-legalize-crash-pr35690.mir | 3 +- .../AArch64/GlobalISel/select-gv-cmodel-large.mir | 3 +- .../CodeGen/AArch64/reverse-csr-restore-seq.mir | 3 +- ...ory-legalizer-multiple-mem-operands-atomics.mir | 8 +++-- ...galizer-multiple-mem-operands-nontemporal-1.mir | 8 +++-- ...galizer-multiple-mem-operands-nontemporal-2.mir | 8 +++-- llvm/test/CodeGen/AMDGPU/sched-crash-dbg-value.mir | 3 +- llvm/test/CodeGen/AMDGPU/twoaddr-mad.mir | 4 +-- .../AMDGPU/undefined-physreg-sgpr-spill.mir | 6 ++-- .../test/CodeGen/AMDGPU/vop-shrink-frame-index.mir | 24 ++++++------- llvm/test/CodeGen/ARM/fp16-litpool2-arm.mir | 3 +- llvm/test/CodeGen/ARM/fp16-litpool3-arm.mir | 3 +- .../CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir | 21 +++++++---- .../CodeGen/MIR/AArch64/mirCanonIdempotent.mir | 21 +++++++---- .../MIR/AArch64/stack-object-local-offset.mir | 3 +- llvm/test/CodeGen/MIR/X86/callee-saved-info.mir | 2 +- .../X86/expected-metadata-node-in-stack-object.mir | 5 +-- llvm/test/CodeGen/MIR/X86/fixed-stack-di.mir | 42 ++++++++++++++++++++++ .../CodeGen/MIR/X86/invalid-metadata-node-type.mir | 7 ++-- .../MIR/X86/spill-slot-fixed-stack-objects.mir | 3 +- .../CodeGen/MIR/X86/stack-object-debug-info.mir | 8 +++-- llvm/test/CodeGen/MIR/X86/stack-objects.mir | 6 ++-- .../MIR/X86/variable-sized-stack-objects.mir | 4 +-- llvm/test/CodeGen/Mips/micromips-eva.mir | 3 +- .../CodeGen/Mips/micromips-short-delay-slot.mir | 3 +- llvm/test/CodeGen/Mips/msa/emergency-spill.mir | 27 +++++++++----- .../CodeGen/PowerPC/convert-rr-to-ri-instrs.mir | 15 +++++--- .../X86/GlobalISel/x32-select-frameIndex.mir | 3 +- .../X86/GlobalISel/x86-select-frameIndex.mir | 3 +- .../X86/GlobalISel/x86_64-select-frameIndex.mir | 3 +- llvm/test/CodeGen/X86/fixed-stack-di-mir.ll | 32 +++++++++++++++++ llvm/test/CodeGen/X86/movtopush.mir | 9 +++-- llvm/test/CodeGen/X86/pr30821.mir | 7 ++-- .../MIR/AArch64/implicit-def-dead-scope.mir | 12 +++---- llvm/test/DebugInfo/MIR/Mips/last-inst-bundled.mir | 9 +++-- llvm/test/DebugInfo/MIR/X86/kill-after-spill.mir | 6 ++-- llvm/test/DebugInfo/X86/live-debug-vars-dse.mir | 4 +-- 43 files changed, 286 insertions(+), 127 deletions(-) create mode 100644 llvm/test/CodeGen/MIR/X86/fixed-stack-di.mir create mode 100644 llvm/test/CodeGen/X86/fixed-stack-di-mir.ll diff --git a/llvm/include/llvm/CodeGen/MIRYamlMapping.h b/llvm/include/llvm/CodeGen/MIRYamlMapping.h index be04fd5..7f46406 100644 --- a/llvm/include/llvm/CodeGen/MIRYamlMapping.h +++ b/llvm/include/llvm/CodeGen/MIRYamlMapping.h @@ -258,11 +258,11 @@ template <> struct MappingTraits { YamlIO.mapOptional("callee-saved-restored", Object.CalleeSavedRestored, true); YamlIO.mapOptional("local-offset", Object.LocalOffset, Optional()); - YamlIO.mapOptional("di-variable", Object.DebugVar, + YamlIO.mapOptional("debug-info-variable", Object.DebugVar, StringValue()); // Don't print it out when it's empty. - YamlIO.mapOptional("di-expression", Object.DebugExpr, + YamlIO.mapOptional("debug-info-expression", Object.DebugExpr, StringValue()); // Don't print it out when it's empty. - YamlIO.mapOptional("di-location", Object.DebugLoc, + YamlIO.mapOptional("debug-info-location", Object.DebugLoc, StringValue()); // Don't print it out when it's empty. } @@ -283,6 +283,9 @@ struct FixedMachineStackObject { bool IsAliased = false; StringValue CalleeSavedRegister; bool CalleeSavedRestored = true; + StringValue DebugVar; + StringValue DebugExpr; + StringValue DebugLoc; bool operator==(const FixedMachineStackObject &Other) const { return ID == Other.ID && Type == Other.Type && Offset == Other.Offset && @@ -290,7 +293,9 @@ struct FixedMachineStackObject { StackID == Other.StackID && IsImmutable == Other.IsImmutable && IsAliased == Other.IsAliased && CalleeSavedRegister == Other.CalleeSavedRegister && - CalleeSavedRestored == Other.CalleeSavedRestored; + CalleeSavedRestored == Other.CalleeSavedRestored && + DebugVar == Other.DebugVar && DebugExpr == Other.DebugExpr + && DebugLoc == Other.DebugLoc; } }; @@ -321,6 +326,12 @@ template <> struct MappingTraits { StringValue()); // Don't print it out when it's empty. YamlIO.mapOptional("callee-saved-restored", Object.CalleeSavedRestored, true); + YamlIO.mapOptional("debug-info-variable", Object.DebugVar, + StringValue()); // Don't print it out when it's empty. + YamlIO.mapOptional("debug-info-expression", Object.DebugExpr, + StringValue()); // Don't print it out when it's empty. + YamlIO.mapOptional("debug-info-location", Object.DebugLoc, + StringValue()); // Don't print it out when it's empty. } static const bool flow = true; diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h index 7d8b7eb..bbc2299 100644 --- a/llvm/include/llvm/CodeGen/MachineFunction.h +++ b/llvm/include/llvm/CodeGen/MachineFunction.h @@ -349,11 +349,12 @@ public: struct VariableDbgInfo { const DILocalVariable *Var; const DIExpression *Expr; - unsigned Slot; + // The Slot can be negative for fixed stack objects. + int Slot; const DILocation *Loc; VariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, - unsigned Slot, const DILocation *Loc) + int Slot, const DILocation *Loc) : Var(Var), Expr(Expr), Slot(Slot), Loc(Loc) {} }; using VariableDbgInfoMapTy = SmallVector; @@ -860,7 +861,7 @@ public: /// Collect information used to emit debugging information of a variable. void setVariableDbgInfo(const DILocalVariable *Var, const DIExpression *Expr, - unsigned Slot, const DILocation *Loc) { + int Slot, const DILocation *Loc) { VariableDbgInfos.emplace_back(Var, Expr, Slot, Loc); } diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index 3781024..3d2db97 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -122,8 +122,9 @@ public: const yaml::StringValue &RegisterSource, bool IsRestored, int FrameIdx); + template bool parseStackObjectsDebugInfo(PerFunctionMIParsingState &PFS, - const yaml::MachineStackObject &Object, + const T &Object, int FrameIdx); bool initializeConstantPool(PerFunctionMIParsingState &PFS, @@ -616,6 +617,8 @@ bool MIRParserImpl::initializeFrameInfo(PerFunctionMIParsingState &PFS, if (parseCalleeSavedRegister(PFS, CSIInfo, Object.CalleeSavedRegister, Object.CalleeSavedRestored, ObjectIdx)) return true; + if (parseStackObjectsDebugInfo(PFS, Object, ObjectIdx)) + return true; } // Initialize the ordinary frame objects. @@ -700,11 +703,11 @@ static bool typecheckMDNode(T *&Result, MDNode *Node, return false; } +template bool MIRParserImpl::parseStackObjectsDebugInfo(PerFunctionMIParsingState &PFS, - const yaml::MachineStackObject &Object, int FrameIdx) { + const T &Object, int FrameIdx) { // Debug information can only be attached to stack objects; Fixed stack // objects aren't supported. - assert(FrameIdx >= 0 && "Expected a stack object frame index"); MDNode *Var = nullptr, *Expr = nullptr, *Loc = nullptr; if (parseMDNode(PFS, Var, Object.DebugVar) || parseMDNode(PFS, Expr, Object.DebugExpr) || @@ -719,7 +722,7 @@ bool MIRParserImpl::parseStackObjectsDebugInfo(PerFunctionMIParsingState &PFS, typecheckMDNode(DIExpr, Expr, Object.DebugExpr, "DIExpression", *this) || typecheckMDNode(DILoc, Loc, Object.DebugLoc, "DILocation", *this)) return true; - PFS.MF.setVariableDbgInfo(DIVar, DIExpr, unsigned(FrameIdx), DILoc); + PFS.MF.setVariableDbgInfo(DIVar, DIExpr, FrameIdx, DILoc); return false; } diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index 15a6a57..797affa 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -256,6 +256,21 @@ static void printRegClassOrBank(unsigned Reg, yaml::StringValue &Dest, OS << printRegClassOrBank(Reg, RegInfo, TRI); } +template +static void +printStackObjectDbgInfo(const MachineFunction::VariableDbgInfo &DebugVar, + T &Object, ModuleSlotTracker &MST) { + std::array Outputs{{&Object.DebugVar.Value, + &Object.DebugExpr.Value, + &Object.DebugLoc.Value}}; + std::array Metas{{DebugVar.Var, + DebugVar.Expr, + DebugVar.Loc}}; + for (unsigned i = 0; i < 3; ++i) { + raw_string_ostream StrOS(*Outputs[i]); + Metas[i]->printAsOperand(StrOS, MST); + } +} void MIRPrinter::convert(yaml::MachineFunction &MF, const MachineRegisterInfo &RegInfo, @@ -421,19 +436,12 @@ void MIRPrinter::convertStackObjects(yaml::MachineFunction &YMF, assert(StackObjectInfo != StackObjectOperandMapping.end() && "Invalid stack object index"); const FrameIndexOperand &StackObject = StackObjectInfo->second; - assert(!StackObject.IsFixed && "Expected a non-fixed stack object"); - auto &Object = YMF.StackObjects[StackObject.ID]; - { - raw_string_ostream StrOS(Object.DebugVar.Value); - DebugVar.Var->printAsOperand(StrOS, MST); - } - { - raw_string_ostream StrOS(Object.DebugExpr.Value); - DebugVar.Expr->printAsOperand(StrOS, MST); - } - { - raw_string_ostream StrOS(Object.DebugLoc.Value); - DebugVar.Loc->printAsOperand(StrOS, MST); + if (StackObject.IsFixed) { + auto &Object = YMF.FixedStackObjects[StackObject.ID]; + printStackObjectDbgInfo(DebugVar, Object, MST); + } else { + auto &Object = YMF.StackObjects[StackObject.ID]; + printStackObjectDbgInfo(DebugVar, Object, MST); } } } diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll index da5d814..3c8d103 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll +++ b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll @@ -33,13 +33,13 @@ define i64 @muli64(i64 %arg1, i64 %arg2) { ; CHECK: stack: ; CHECK-NEXT: - { id: 0, name: ptr1, type: default, offset: 0, size: 8, alignment: 8, ; CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true, -; CHECK-NEXT: di-variable: '', di-expression: '', di-location: '' } +; CHECK-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } ; CHECK-NEXT: - { id: 1, name: ptr2, type: default, offset: 0, size: 8, alignment: 1, ; CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true, -; CHECK-NEXT: di-variable: '', di-expression: '', di-location: '' } +; CHECK-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } ; CHECK-NEXT: - { id: 2, name: ptr3, type: default, offset: 0, size: 128, alignment: 8, ; CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true, -; CHECK-NEXT: di-variable: '', di-expression: '', di-location: '' } +; CHECK-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } ; CHECK-NEXT: - { id: 3, name: ptr4, type: default, offset: 0, size: 1, alignment: 8, ; CHECK: %{{[0-9]+}}:_(p0) = G_FRAME_INDEX %stack.0.ptr1 ; CHECK: %{{[0-9]+}}:_(p0) = G_FRAME_INDEX %stack.1.ptr2 diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll b/llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll index a2466c7..a63a702 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll +++ b/llvm/test/CodeGen/AArch64/GlobalISel/debug-insts.ll @@ -5,7 +5,7 @@ ; CHECK: stack: ; CHECK: - { id: {{.*}}, name: in.addr, type: default, offset: 0, size: {{.*}}, alignment: {{.*}}, ; CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true, -; CHECK-NEXT: di-variable: '!11', di-expression: '!DIExpression()', +; CHECK-NEXT: debug-info-variable: '!11', debug-info-expression: '!DIExpression()', ; CHECK: DBG_VALUE debug-use %0(s32), debug-use $noreg, !11, !DIExpression(), debug-location !12 define void @debug_declare(i32 %in) #0 !dbg !7 { entry: diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/fp128-legalize-crash-pr35690.mir b/llvm/test/CodeGen/AArch64/GlobalISel/fp128-legalize-crash-pr35690.mir index 885fa0c..b5e416c 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/fp128-legalize-crash-pr35690.mir +++ b/llvm/test/CodeGen/AArch64/GlobalISel/fp128-legalize-crash-pr35690.mir @@ -25,7 +25,8 @@ fixedStack: stack: - { id: 0, name: a.addr, type: default, offset: 0, size: 16, alignment: 16, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } body: | bb.1.entry: liveins: $q0 diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/select-gv-cmodel-large.mir b/llvm/test/CodeGen/AArch64/GlobalISel/select-gv-cmodel-large.mir index 623dd46..ba4fdb5 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/select-gv-cmodel-large.mir +++ b/llvm/test/CodeGen/AArch64/GlobalISel/select-gv-cmodel-large.mir @@ -24,7 +24,8 @@ regBankSelected: true stack: - { id: 0, name: retval, type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.1: diff --git a/llvm/test/CodeGen/AArch64/reverse-csr-restore-seq.mir b/llvm/test/CodeGen/AArch64/reverse-csr-restore-seq.mir index f0f67029..32234fd 100644 --- a/llvm/test/CodeGen/AArch64/reverse-csr-restore-seq.mir +++ b/llvm/test/CodeGen/AArch64/reverse-csr-restore-seq.mir @@ -46,7 +46,8 @@ tracksRegLiveness: true stack: - { id : 0, size: 8, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -4, di-variable: '', di-expression: '', di-location: '' } + local-offset: -4, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } body: | bb.0: diff --git a/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-atomics.mir b/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-atomics.mir index ccf11ad..e24624e 100644 --- a/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-atomics.mir +++ b/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-atomics.mir @@ -103,11 +103,13 @@ fixedStack: isImmutable: false, isAliased: false, callee-saved-register: '' } stack: - { id: 0, name: scratch0, type: default, offset: 4, size: 32768, alignment: 4, - stack-id: 0, callee-saved-register: '', local-offset: 0, di-variable: '', - di-expression: '', di-location: '' } + stack-id: 0, callee-saved-register: '', local-offset: 0, + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 1, name: scratch1, type: default, offset: 32772, size: 32768, alignment: 4, stack-id: 0, callee-saved-register: '', local-offset: 32768, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-nontemporal-1.mir b/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-nontemporal-1.mir index f7849d3..ef30887 100644 --- a/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-nontemporal-1.mir +++ b/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-nontemporal-1.mir @@ -101,11 +101,13 @@ fixedStack: isImmutable: false, isAliased: false, callee-saved-register: '' } stack: - { id: 0, name: scratch0, type: default, offset: 4, size: 32768, alignment: 4, - stack-id: 0, callee-saved-register: '', local-offset: 0, di-variable: '', - di-expression: '', di-location: '' } + stack-id: 0, callee-saved-register: '', local-offset: 0, + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 1, name: scratch1, type: default, offset: 32772, size: 32768, alignment: 4, stack-id: 0, callee-saved-register: '', local-offset: 32768, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-nontemporal-2.mir b/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-nontemporal-2.mir index d0ee5b5d..92b6074 100644 --- a/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-nontemporal-2.mir +++ b/llvm/test/CodeGen/AMDGPU/memory-legalizer-multiple-mem-operands-nontemporal-2.mir @@ -101,11 +101,13 @@ fixedStack: isImmutable: false, isAliased: false, callee-saved-register: '' } stack: - { id: 0, name: scratch0, type: default, offset: 4, size: 32768, alignment: 4, - stack-id: 0, callee-saved-register: '', local-offset: 0, di-variable: '', - di-expression: '', di-location: '' } + stack-id: 0, callee-saved-register: '', local-offset: 0, + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 1, name: scratch1, type: default, offset: 32772, size: 32768, alignment: 4, stack-id: 0, callee-saved-register: '', local-offset: 32768, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/CodeGen/AMDGPU/sched-crash-dbg-value.mir b/llvm/test/CodeGen/AMDGPU/sched-crash-dbg-value.mir index 41023d0..7fdeb22 100644 --- a/llvm/test/CodeGen/AMDGPU/sched-crash-dbg-value.mir +++ b/llvm/test/CodeGen/AMDGPU/sched-crash-dbg-value.mir @@ -188,7 +188,8 @@ fixedStack: stack: - { id: 0, name: tmp5, type: default, offset: 0, size: 128, alignment: 16, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: 0, di-variable: '', di-expression: '', di-location: '' } + local-offset: 0, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.bb: diff --git a/llvm/test/CodeGen/AMDGPU/twoaddr-mad.mir b/llvm/test/CodeGen/AMDGPU/twoaddr-mad.mir index f2eb1db..33f9452 100644 --- a/llvm/test/CodeGen/AMDGPU/twoaddr-mad.mir +++ b/llvm/test/CodeGen/AMDGPU/twoaddr-mad.mir @@ -179,8 +179,8 @@ registers: - { id: 2, class: vgpr_32 } stack: - { id: 0, name: "", type: default, offset: 0, size: 128, alignment: 8, - callee-saved-register: '', local-offset: 0, di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '', local-offset: 0, debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } body: | bb.0: diff --git a/llvm/test/CodeGen/AMDGPU/undefined-physreg-sgpr-spill.mir b/llvm/test/CodeGen/AMDGPU/undefined-physreg-sgpr-spill.mir index bea8d9d..0103f0a 100644 --- a/llvm/test/CodeGen/AMDGPU/undefined-physreg-sgpr-spill.mir +++ b/llvm/test/CodeGen/AMDGPU/undefined-physreg-sgpr-spill.mir @@ -35,7 +35,8 @@ liveins: stack: - { id: 0, name: '', type: spill-slot, offset: 0, size: 8, alignment: 4, stack-id: 1, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0: @@ -98,7 +99,8 @@ liveins: stack: - { id: 0, name: '', type: spill-slot, offset: 0, size: 8, alignment: 4, stack-id: 1, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0: diff --git a/llvm/test/CodeGen/AMDGPU/vop-shrink-frame-index.mir b/llvm/test/CodeGen/AMDGPU/vop-shrink-frame-index.mir index 548376d..5a511bd 100644 --- a/llvm/test/CodeGen/AMDGPU/vop-shrink-frame-index.mir +++ b/llvm/test/CodeGen/AMDGPU/vop-shrink-frame-index.mir @@ -44,8 +44,8 @@ registers: - { id: 2, class: vgpr_32 } stack: - { id: 0, name: alloca, type: default, offset: 0, size: 128, alignment: 8, - callee-saved-register: '', local-offset: 0, di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '', local-offset: 0, debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } body: | bb.0: %0 = V_MOV_B32_e32 %stack.0.alloca, implicit $exec @@ -65,8 +65,8 @@ registers: - { id: 2, class: vgpr_32 } stack: - { id: 0, name: alloca, type: default, offset: 0, size: 128, alignment: 8, - callee-saved-register: '', local-offset: 0, di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '', local-offset: 0, debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } body: | bb.0: %0 = V_MOV_B32_e32 %stack.0.alloca, implicit $exec @@ -87,8 +87,8 @@ registers: - { id: 2, class: vgpr_32 } stack: - { id: 0, name: alloca, type: default, offset: 0, size: 128, alignment: 8, - callee-saved-register: '', local-offset: 0, di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '', local-offset: 0, debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } body: | bb.0: %0 = V_MOV_B32_e32 %stack.0.alloca, implicit $exec @@ -109,8 +109,8 @@ registers: - { id: 2, class: vgpr_32 } stack: - { id: 0, name: alloca, type: default, offset: 0, size: 128, alignment: 8, - callee-saved-register: '', local-offset: 0, di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '', local-offset: 0, debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } body: | bb.0: %0 = V_MOV_B32_e32 %stack.0.alloca, implicit $exec @@ -130,8 +130,8 @@ registers: - { id: 2, class: vgpr_32 } stack: - { id: 0, name: alloca, type: default, offset: 0, size: 128, alignment: 8, - callee-saved-register: '', local-offset: 0, di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '', local-offset: 0, debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } body: | bb.0: %0 = V_MOV_B32_e32 %stack.0.alloca, implicit $exec @@ -151,8 +151,8 @@ registers: - { id: 2, class: vgpr_32 } stack: - { id: 0, name: alloca, type: default, offset: 0, size: 128, alignment: 8, - callee-saved-register: '', local-offset: 0, di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '', local-offset: 0, debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } body: | bb.0: %0 = V_MOV_B32_e32 %stack.0.alloca, implicit $exec diff --git a/llvm/test/CodeGen/ARM/fp16-litpool2-arm.mir b/llvm/test/CodeGen/ARM/fp16-litpool2-arm.mir index e45010a..86738a5 100644 --- a/llvm/test/CodeGen/ARM/fp16-litpool2-arm.mir +++ b/llvm/test/CodeGen/ARM/fp16-litpool2-arm.mir @@ -67,7 +67,8 @@ fixedStack: stack: - { id: 0, name: res, type: default, offset: -2, size: 2, alignment: 2, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -2, di-variable: '', di-expression: '', di-location: '' } + local-offset: -2, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: - id: 0 value: half 0xH706B diff --git a/llvm/test/CodeGen/ARM/fp16-litpool3-arm.mir b/llvm/test/CodeGen/ARM/fp16-litpool3-arm.mir index 6385d79..6d27d96 100644 --- a/llvm/test/CodeGen/ARM/fp16-litpool3-arm.mir +++ b/llvm/test/CodeGen/ARM/fp16-litpool3-arm.mir @@ -68,7 +68,8 @@ fixedStack: stack: - { id: 0, name: res, type: default, offset: -2, size: 2, alignment: 2, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -2, di-variable: '', di-expression: '', di-location: '' } + local-offset: -2, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: - id: 0 value: half 0xH706B diff --git a/llvm/test/CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir b/llvm/test/CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir index f3c2007..8ab40c7 100644 --- a/llvm/test/CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir +++ b/llvm/test/CodeGen/MIR/AArch64/mirCanonCopyCopyProp.mir @@ -6,25 +6,32 @@ name: Proc8 stack: - { id: 0, type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -4, di-variable: '', di-expression: '', di-location: '' } + local-offset: -4, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 1, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -16, di-variable: '', di-expression: '', di-location: '' } + local-offset: -16, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 2, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -24, di-variable: '', di-expression: '', di-location: '' } + local-offset: -24, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 3, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -32, di-variable: '', di-expression: '', di-location: '' } + local-offset: -32, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 4, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -40, di-variable: '', di-expression: '', di-location: '' } + local-offset: -40, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 5, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -48, di-variable: '', di-expression: '', di-location: '' } + local-offset: -48, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 6, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -56, di-variable: '', di-expression: '', di-location: '' } + local-offset: -56, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0: diff --git a/llvm/test/CodeGen/MIR/AArch64/mirCanonIdempotent.mir b/llvm/test/CodeGen/MIR/AArch64/mirCanonIdempotent.mir index a91ebdd..72e8f0b 100644 --- a/llvm/test/CodeGen/MIR/AArch64/mirCanonIdempotent.mir +++ b/llvm/test/CodeGen/MIR/AArch64/mirCanonIdempotent.mir @@ -11,25 +11,32 @@ name: Proc8 stack: - { id: 0, type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -4, di-variable: '', di-expression: '', di-location: '' } + local-offset: -4, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 1, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -16, di-variable: '', di-expression: '', di-location: '' } + local-offset: -16, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 2, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -24, di-variable: '', di-expression: '', di-location: '' } + local-offset: -24, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 3, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -32, di-variable: '', di-expression: '', di-location: '' } + local-offset: -32, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 4, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -40, di-variable: '', di-expression: '', di-location: '' } + local-offset: -40, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 5, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -48, di-variable: '', di-expression: '', di-location: '' } + local-offset: -48, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 6, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -56, di-variable: '', di-expression: '', di-location: '' } + local-offset: -56, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0: diff --git a/llvm/test/CodeGen/MIR/AArch64/stack-object-local-offset.mir b/llvm/test/CodeGen/MIR/AArch64/stack-object-local-offset.mir index 6fc92e7..639bb66 100644 --- a/llvm/test/CodeGen/MIR/AArch64/stack-object-local-offset.mir +++ b/llvm/test/CodeGen/MIR/AArch64/stack-object-local-offset.mir @@ -27,7 +27,8 @@ frameInfo: # CHECK: stack: # CHECK: - { id: 0, name: local_var, type: default, offset: 0, size: 8, alignment: 8, # CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true, -# CHECK-NEXT: local-offset: -8, di-variable: '', di-expression: '', di-location: '' } +# CHECK-NEXT: local-offset: -8, debug-info-variable: '', debug-info-expression: '', +# CHECK-NEXT: debug-info-location: '' } stack: - { id: 0,name: local_var,offset: 0,size: 8,alignment: 8, local-offset: -8 } body: | diff --git a/llvm/test/CodeGen/MIR/X86/callee-saved-info.mir b/llvm/test/CodeGen/MIR/X86/callee-saved-info.mir index 98c1e3a..d5cd26c 100644 --- a/llvm/test/CodeGen/MIR/X86/callee-saved-info.mir +++ b/llvm/test/CodeGen/MIR/X86/callee-saved-info.mir @@ -50,7 +50,7 @@ frameInfo: adjustsStack: true hasCalls: true # CHECK: fixedStack: -# CHECK: callee-saved-register: '$rbx', callee-saved-restored: true } +# CHECK: callee-saved-register: '$rbx', callee-saved-restored: true fixedStack: - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, callee-saved-register: '$rbx' } # CHECK: stack: diff --git a/llvm/test/CodeGen/MIR/X86/expected-metadata-node-in-stack-object.mir b/llvm/test/CodeGen/MIR/X86/expected-metadata-node-in-stack-object.mir index f68dd86..4ffb0b2 100644 --- a/llvm/test/CodeGen/MIR/X86/expected-metadata-node-in-stack-object.mir +++ b/llvm/test/CodeGen/MIR/X86/expected-metadata-node-in-stack-object.mir @@ -13,8 +13,9 @@ name: test liveins: - { reg: '$edi' } stack: -# CHECK: [[@LINE+1]]:74: expected a metadata node - - { id: 0, name: xa, offset: -12, size: 4, alignment: 4, di-variable: '0' } + - { id: 0, name: xa, offset: -12, size: 4, alignment: 4, +# CHECK: [[@LINE+1]]:29: expected a metadata node + debug-info-variable: '0' } body: | bb.0.entry: liveins: $edi diff --git a/llvm/test/CodeGen/MIR/X86/fixed-stack-di.mir b/llvm/test/CodeGen/MIR/X86/fixed-stack-di.mir new file mode 100644 index 0000000..209ed3e --- /dev/null +++ b/llvm/test/CodeGen/MIR/X86/fixed-stack-di.mir @@ -0,0 +1,42 @@ +# RUN: llc -mtriple=x86_64-apple-unknown -run-pass none %s -o /dev/null +# Check that we parse the 'debug-info-*' fields for `fixedStack:` entries. + +--- | + + target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" + target triple = "x86_64-apple-unknown" + + declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 + + define hidden void @foo(i32* byval %dstRect) { + entry: + call void @llvm.dbg.declare(metadata i32* %dstRect, metadata !3, metadata !DIExpression()), !dbg !5 + unreachable + } + + attributes #0 = { nounwind readnone speculatable } + + !llvm.dbg.cu = !{!0} + !llvm.module.flags = !{!2} + + !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1) + !1 = !DIFile(filename: "file.cpp", directory: "/dir") + !2 = !{i32 2, !"Debug Info Version", i32 3} + !3 = !DILocalVariable(name: "dstRect", scope: !4) + !4 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !0, file: !1, line: 42, unit: !0) + !5 = !DILocation(line: 42, column: 85, scope: !4) + +... +--- +name: foo +alignment: 4 +tracksRegLiveness: true +frameInfo: + maxAlignment: 8 +fixedStack: + - { id: 0, size: 4, alignment: 16, stack-id: 0, debug-info-variable: '!3', debug-info-expression: '!DIExpression()', + debug-info-location: '!5' } +body: | + bb.0.entry: + +... diff --git a/llvm/test/CodeGen/MIR/X86/invalid-metadata-node-type.mir b/llvm/test/CodeGen/MIR/X86/invalid-metadata-node-type.mir index c921e49..30a8c6b 100644 --- a/llvm/test/CodeGen/MIR/X86/invalid-metadata-node-type.mir +++ b/llvm/test/CodeGen/MIR/X86/invalid-metadata-node-type.mir @@ -38,9 +38,10 @@ tracksRegLiveness: true frameInfo: maxAlignment: 16 stack: -# CHECK: [[@LINE+1]]:75: expected a reference to a 'DILocalVariable' metadata node - - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!8', - di-expression: '!7', di-location: '!8' } + - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, +# CHECK: [[@LINE+1]]:28: expected a reference to a 'DILocalVariable' metadata node + debug-info-variable: '!8', debug-info-expression: '!7', + debug-info-location: '!8' } body: | bb.0.entry: successors: %bb.1.for.body diff --git a/llvm/test/CodeGen/MIR/X86/spill-slot-fixed-stack-objects.mir b/llvm/test/CodeGen/MIR/X86/spill-slot-fixed-stack-objects.mir index 0bad077..b5a6edb3 100644 --- a/llvm/test/CodeGen/MIR/X86/spill-slot-fixed-stack-objects.mir +++ b/llvm/test/CodeGen/MIR/X86/spill-slot-fixed-stack-objects.mir @@ -20,7 +20,8 @@ frameInfo: maxAlignment: 4 # CHECK: fixedStack: # CHECK-NEXT: - { id: 0, type: spill-slot, offset: 0, size: 4, alignment: 4, stack-id: 0, -# CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true } +# CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true, debug-info-variable: '', +# CHECK-NEXT: debug-info-expression: '', debug-info-location: '' } fixedStack: - { id: 0, type: spill-slot, offset: 0, size: 4, alignment: 4 } stack: diff --git a/llvm/test/CodeGen/MIR/X86/stack-object-debug-info.mir b/llvm/test/CodeGen/MIR/X86/stack-object-debug-info.mir index 554d73b9..bfaf8a4 100644 --- a/llvm/test/CodeGen/MIR/X86/stack-object-debug-info.mir +++ b/llvm/test/CodeGen/MIR/X86/stack-object-debug-info.mir @@ -52,10 +52,12 @@ frameInfo: # CHECK: stack: # CHECK: - { id: 0, name: y.i, type: default, offset: 0, size: 256, alignment: 16, # CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true, -# CHECK-NEXT: di-variable: '!4', di-expression: '!DIExpression()', di-location: '!10' } +# CHECK-NEXT: debug-info-variable: '!4', debug-info-expression: '!DIExpression()', +# CHECK-NEXT: debug-info-location: '!10' } stack: - - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4', - di-expression: '!DIExpression()', di-location: '!7' } + - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, + debug-info-variable: '!4', debug-info-expression: '!DIExpression()', + debug-info-location: '!7' } body: | bb.0.entry: successors: %bb.1.for.body diff --git a/llvm/test/CodeGen/MIR/X86/stack-objects.mir b/llvm/test/CodeGen/MIR/X86/stack-objects.mir index 1e6e688..0e2debe 100644 --- a/llvm/test/CodeGen/MIR/X86/stack-objects.mir +++ b/llvm/test/CodeGen/MIR/X86/stack-objects.mir @@ -23,13 +23,13 @@ frameInfo: # CHECK: stack: # CHECK-NEXT: - { id: 0, name: b, type: default, offset: -12, size: 4, alignment: 4, # CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true, -# CHECK-NEXT: di-variable: '', di-expression: '', di-location: '' } +# CHECK-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } # CHECK-NEXT: - { id: 1, name: x, type: default, offset: -24, size: 8, alignment: 8, # CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true, -# CHECK-NEXT: di-variable: '', di-expression: '', di-location: '' } +# CHECK-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } # CHECK-NEXT: - { id: 2, name: '', type: spill-slot, offset: -32, size: 4, alignment: 4, # CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true, -# CHECK-NEXT: di-variable: '', di-expression: '', di-location: '' } +# CHECK-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } stack: - { id: 0, name: b, offset: -12, size: 4, alignment: 4 } - { id: 1, name: x, offset: -24, size: 8, alignment: 8 } diff --git a/llvm/test/CodeGen/MIR/X86/variable-sized-stack-objects.mir b/llvm/test/CodeGen/MIR/X86/variable-sized-stack-objects.mir index 5fd54358..b8a8e59 100644 --- a/llvm/test/CodeGen/MIR/X86/variable-sized-stack-objects.mir +++ b/llvm/test/CodeGen/MIR/X86/variable-sized-stack-objects.mir @@ -26,10 +26,10 @@ frameInfo: # CHECK: stack: # CHECK-NEXT: - { id: 0, name: '', type: default, offset: -20, size: 4, alignment: 4, # CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true, -# CHECK-NEXT: di-variable: '', di-expression: '', di-location: '' } +# CHECK-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } # CHECK-NEXT: - { id: 1, name: '', type: default, offset: -32, size: 8, alignment: 8, # CHECK-NEXT: stack-id: 0, callee-saved-register: '', callee-saved-restored: true, -# CHECK-NEXT: di-variable: '', di-expression: '', di-location: '' } +# CHECK-NEXT: debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } # CHECK-NEXT: - { id: 2, name: y, type: variable-sized, offset: -32, alignment: 1, stack: - { id: 0, offset: -20, size: 4, alignment: 4 } diff --git a/llvm/test/CodeGen/Mips/micromips-eva.mir b/llvm/test/CodeGen/Mips/micromips-eva.mir index 56e74d5..cfa24c5 100644 --- a/llvm/test/CodeGen/Mips/micromips-eva.mir +++ b/llvm/test/CodeGen/Mips/micromips-eva.mir @@ -163,7 +163,8 @@ fixedStack: stack: - { id: 0, name: z.addr, type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/CodeGen/Mips/micromips-short-delay-slot.mir b/llvm/test/CodeGen/Mips/micromips-short-delay-slot.mir index 89f20a5..1f17b42 100644 --- a/llvm/test/CodeGen/Mips/micromips-short-delay-slot.mir +++ b/llvm/test/CodeGen/Mips/micromips-short-delay-slot.mir @@ -49,7 +49,8 @@ fixedStack: stack: - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '$ra', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/CodeGen/Mips/msa/emergency-spill.mir b/llvm/test/CodeGen/Mips/msa/emergency-spill.mir index c4a8806..4da537b 100644 --- a/llvm/test/CodeGen/Mips/msa/emergency-spill.mir +++ b/llvm/test/CodeGen/Mips/msa/emergency-spill.mir @@ -102,23 +102,32 @@ frameInfo: fixedStack: stack: - { id: 0, name: retval, type: default, offset: 0, size: 16, alignment: 16, - callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 1, name: a, type: default, offset: 0, size: 16, alignment: 16, - callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 2, name: b, type: default, offset: 0, size: 16, alignment: 16, - callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 3, name: a.addr, type: default, offset: 0, size: 16, alignment: 16, - callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 4, name: b.addr, type: default, offset: 0, size: 16, alignment: 16, - callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 5, name: c.addr, type: default, offset: 0, size: 4, alignment: 4, - callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 6, name: g, type: default, offset: 0, size: 8, alignment: 8, - callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 7, name: d, type: default, offset: 0, size: 8, alignment: 8, - callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 8, name: '', type: default, offset: 0, size: 6400, - alignment: 16, callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' } + alignment: 16, callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/CodeGen/PowerPC/convert-rr-to-ri-instrs.mir b/llvm/test/CodeGen/PowerPC/convert-rr-to-ri-instrs.mir index d1058e3..16e09c9 100644 --- a/llvm/test/CodeGen/PowerPC/convert-rr-to-ri-instrs.mir +++ b/llvm/test/CodeGen/PowerPC/convert-rr-to-ri-instrs.mir @@ -3075,19 +3075,24 @@ fixedStack: stack: - { id: 0, name: '', type: default, offset: 0, size: 16, alignment: 16, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -16, di-variable: '', di-expression: '', di-location: '' } + local-offset: -16, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 1, name: '', type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -20, di-variable: '', di-expression: '', di-location: '' } + local-offset: -20, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 2, name: '', type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -24, di-variable: '', di-expression: '', di-location: '' } + local-offset: -24, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 3, name: '', type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -28, di-variable: '', di-expression: '', di-location: '' } + local-offset: -28, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 4, name: '', type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - local-offset: -32, di-variable: '', di-expression: '', di-location: '' } + local-offset: -32, debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/CodeGen/X86/GlobalISel/x32-select-frameIndex.mir b/llvm/test/CodeGen/X86/GlobalISel/x32-select-frameIndex.mir index df6f35b..0c5671e 100644 --- a/llvm/test/CodeGen/X86/GlobalISel/x32-select-frameIndex.mir +++ b/llvm/test/CodeGen/X86/GlobalISel/x32-select-frameIndex.mir @@ -19,7 +19,8 @@ fixedStack: stack: - { id: 0, name: ptr1, type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } body: | bb.1 (%ir-block.0): diff --git a/llvm/test/CodeGen/X86/GlobalISel/x86-select-frameIndex.mir b/llvm/test/CodeGen/X86/GlobalISel/x86-select-frameIndex.mir index 5824441..ca9083f 100644 --- a/llvm/test/CodeGen/X86/GlobalISel/x86-select-frameIndex.mir +++ b/llvm/test/CodeGen/X86/GlobalISel/x86-select-frameIndex.mir @@ -19,7 +19,8 @@ fixedStack: stack: - { id: 0, name: ptr1, type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } body: | bb.1 (%ir-block.0): diff --git a/llvm/test/CodeGen/X86/GlobalISel/x86_64-select-frameIndex.mir b/llvm/test/CodeGen/X86/GlobalISel/x86_64-select-frameIndex.mir index aea3766..105b145 100644 --- a/llvm/test/CodeGen/X86/GlobalISel/x86_64-select-frameIndex.mir +++ b/llvm/test/CodeGen/X86/GlobalISel/x86_64-select-frameIndex.mir @@ -19,7 +19,8 @@ fixedStack: stack: - { id: 0, name: ptr1, type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } body: | bb.1 (%ir-block.0): diff --git a/llvm/test/CodeGen/X86/fixed-stack-di-mir.ll b/llvm/test/CodeGen/X86/fixed-stack-di-mir.ll new file mode 100644 index 0000000..714a980e --- /dev/null +++ b/llvm/test/CodeGen/X86/fixed-stack-di-mir.ll @@ -0,0 +1,32 @@ +; RUN: llc -mtriple=x86_64-apple-unknown -stop-before=expand-isel-pseudos %s -o - -simplify-mir | FileCheck %s +; The byval argument of the function will be allocated a fixed stack slot. Test +; that we serialize the fixed slot correctly. + +target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-apple-unknown" + +declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 + +define hidden void @foo(i32* byval %dstRect) { +; CHECK-LABEL: name: foo +entry: + call void @llvm.dbg.declare(metadata i32* %dstRect, metadata !3, metadata !DIExpression()), !dbg !5 +; CHECK: fixedStack: +; CHECK: id: 0 +; CHECK: debug-info-variable: '!3' +; CHECK: debug-info-expression: '!DIExpression()' +; CHECK: debug-info-location: '!5' + unreachable +} + +attributes #0 = { nounwind readnone speculatable } + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!2} + +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1) +!1 = !DIFile(filename: "file.cpp", directory: "/dir") +!2 = !{i32 2, !"Debug Info Version", i32 3} +!3 = !DILocalVariable(name: "dstRect", scope: !4) +!4 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !0, file: !1, line: 42, unit: !0) +!5 = !DILocation(line: 42, column: 85, scope: !4) diff --git a/llvm/test/CodeGen/X86/movtopush.mir b/llvm/test/CodeGen/X86/movtopush.mir index 783eb2e..ea22cb5 100644 --- a/llvm/test/CodeGen/X86/movtopush.mir +++ b/llvm/test/CodeGen/X86/movtopush.mir @@ -89,13 +89,16 @@ fixedStack: stack: - { id: 0, name: p, type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 1, name: q, type: default, offset: 0, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 2, name: s, type: default, offset: 0, size: 8, alignment: 8, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/CodeGen/X86/pr30821.mir b/llvm/test/CodeGen/X86/pr30821.mir index 15a6eb5..170804a 100644 --- a/llvm/test/CodeGen/X86/pr30821.mir +++ b/llvm/test/CodeGen/X86/pr30821.mir @@ -47,13 +47,14 @@ fixedStack: stack: - { id: 0, name: alpha, type: default, offset: 0, size: 1, alignment: 1, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } - { id: 1, name: foxtrot, type: default, offset: 0, size: 16, alignment: 16, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', debug-info-location: '' } - { id: 2, name: india, type: default, offset: 0, size: 16, alignment: 16, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir b/llvm/test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir index a18f942..e77bbad 100644 --- a/llvm/test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir +++ b/llvm/test/DebugInfo/MIR/AArch64/implicit-def-dead-scope.mir @@ -173,14 +173,14 @@ frameInfo: fixedStack: stack: - { id: 0, name: bz, type: default, offset: -32, size: 16, alignment: 8, - callee-saved-register: '', local-offset: -16, di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '', local-offset: -16, debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 1, name: att, type: default, offset: -48, size: 16, alignment: 8, - callee-saved-register: '', local-offset: -32, di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '', local-offset: -32, debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } - { id: 2, name: '', type: spill-slot, offset: -16, size: 8, alignment: 16, - callee-saved-register: '$lr', di-variable: '', di-expression: '', - di-location: '' } + callee-saved-register: '$lr', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/DebugInfo/MIR/Mips/last-inst-bundled.mir b/llvm/test/DebugInfo/MIR/Mips/last-inst-bundled.mir index 92341d3b..024f3b5 100644 --- a/llvm/test/DebugInfo/MIR/Mips/last-inst-bundled.mir +++ b/llvm/test/DebugInfo/MIR/Mips/last-inst-bundled.mir @@ -140,13 +140,16 @@ fixedStack: stack: - { id: 0, name: condition, type: default, offset: -12, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 1, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '$ra', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 2, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '$s0', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/DebugInfo/MIR/X86/kill-after-spill.mir b/llvm/test/DebugInfo/MIR/X86/kill-after-spill.mir index 8d18053..da4d07d 100644 --- a/llvm/test/DebugInfo/MIR/X86/kill-after-spill.mir +++ b/llvm/test/DebugInfo/MIR/X86/kill-after-spill.mir @@ -246,10 +246,12 @@ fixedStack: stack: - { id: 0, name: '', type: spill-slot, offset: -64, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } - { id: 1, name: '', type: spill-slot, offset: -60, size: 4, alignment: 4, stack-id: 0, callee-saved-register: '', callee-saved-restored: true, - di-variable: '', di-expression: '', di-location: '' } + debug-info-variable: '', debug-info-expression: '', + debug-info-location: '' } constants: body: | bb.0.entry: diff --git a/llvm/test/DebugInfo/X86/live-debug-vars-dse.mir b/llvm/test/DebugInfo/X86/live-debug-vars-dse.mir index eae53c2..1857d19 100644 --- a/llvm/test/DebugInfo/X86/live-debug-vars-dse.mir +++ b/llvm/test/DebugInfo/X86/live-debug-vars-dse.mir @@ -119,8 +119,8 @@ frameInfo: fixedStack: stack: - { id: 0, name: x.addr, type: default, offset: 0, size: 4, alignment: 4, - stack-id: 0, callee-saved-register: '', di-variable: '', di-expression: '', - di-location: '' } + stack-id: 0, callee-saved-register: '', debug-info-variable: '', + debug-info-expression: '', debug-info-location: '' } constants: body: | bb.0.entry: -- 2.7.4