]> granicus.if.org Git - llvm/commitdiff
Parse and print DIExpressions inline to ease IR and MIR testing
authorReid Kleckner <rnk@google.com>
Wed, 23 Aug 2017 20:31:27 +0000 (20:31 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 23 Aug 2017 20:31:27 +0000 (20:31 +0000)
Summary:
Most DIExpressions are empty or very simple. When they are complex, they
tend to be unique, so checking them inline is reasonable.

This also avoids the need for CodeGen passes to append to the
llvm.dbg.mir named md node.

See also PR22780, for making DIExpression not be an MDNode.

Reviewers: aprantl, dexonsmith, dblaikie

Subscribers: qcolombet, javed.absar, eraman, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D37075

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311594 91177308-0d34-0410-b5e6-96231b3b80d8

48 files changed:
lib/AsmParser/LLParser.cpp
lib/CodeGen/MIRParser/MILexer.cpp
lib/CodeGen/MIRParser/MILexer.h
lib/CodeGen/MIRParser/MIParser.cpp
lib/IR/AsmWriter.cpp
test/Assembler/DIGlobalVariableExpression.ll
test/Assembler/diexpression.ll
test/Assembler/invalid-diexpression-verify.ll
test/Bitcode/DIExpression-aggresult.ll
test/Bitcode/DIGlobalVariableExpression.ll
test/Bitcode/diglobalvariable-3.8.ll
test/Bitcode/upgrade-dbg-value.ll
test/CodeGen/AArch64/GlobalISel/debug-insts.ll
test/CodeGen/AArch64/GlobalISel/regbankselect-dbg-value.mir
test/CodeGen/AArch64/GlobalISel/select-dbg-value.mir
test/CodeGen/MIR/X86/instructions-debug-location.mir
test/CodeGen/MIR/X86/metadata-operands.mir
test/CodeGen/MIR/X86/stack-object-debug-info.mir
test/CodeGen/X86/lea-opt-with-debug.mir
test/CodeGen/X86/post-ra-sched-with-debug.mir
test/DebugInfo/ARM/sroa-complex.ll
test/DebugInfo/Generic/global-sra-array.ll
test/DebugInfo/Generic/global-sra-struct.ll
test/DebugInfo/MIR/X86/live-debug-values-3preds.mir
test/DebugInfo/MIR/X86/live-debug-values-spill.mir
test/DebugInfo/MIR/X86/live-debug-values.mir
test/DebugInfo/MIR/X86/livedebugvalues-limit.mir
test/DebugInfo/MSP430/sdagsplit-1.ll
test/DebugInfo/X86/array2.ll
test/DebugInfo/X86/bbjoin.ll
test/DebugInfo/X86/safestack-byval.ll
test/DebugInfo/X86/sdagsplit-1.ll
test/DebugInfo/X86/sroasplit-1.ll
test/DebugInfo/X86/sroasplit-2.ll
test/DebugInfo/X86/sroasplit-3.ll
test/DebugInfo/X86/sroasplit-4.ll
test/Instrumentation/AddressSanitizer/debug_info.ll
test/Transforms/GlobalMerge/debug-info.ll
test/Transforms/Inline/inline_dbg_declare.ll
test/Transforms/InstCombine/debuginfo-dce.ll
test/Transforms/LoopRotate/phi-dbgvalue.ll
test/Transforms/Mem2Reg/debug-alloca-phi.ll
test/Transforms/MergeFunc/mergefunc-preserve-debug-info.ll
test/Transforms/SROA/dbg-single-piece.ll
test/Transforms/SafeStack/X86/debug-loc-dynamic.ll
test/Transforms/SafeStack/X86/debug-loc.ll
test/Transforms/SafeStack/X86/debug-loc2.ll
test/Transforms/Util/split-bit-piece.ll

index 828f873d37bc943d761d314fcc1d0517dabd3533..a5f4dd73d30eb642d9ed4c7a5d08e28cd969a2ce 100644 (file)
@@ -643,11 +643,18 @@ bool LLParser::ParseNamedMetadata() {
   NamedMDNode *NMD = M->getOrInsertNamedMetadata(Name);
   if (Lex.getKind() != lltok::rbrace)
     do {
-      if (ParseToken(lltok::exclaim, "Expected '!' here"))
-        return true;
-
       MDNode *N = nullptr;
-      if (ParseMDNodeID(N)) return true;
+      // Parse DIExpressions inline as a special case. They are still MDNodes,
+      // so they can still appear in named metadata. Remove this logic if they
+      // become plain Metadata.
+      if (Lex.getKind() == lltok::MetadataVar &&
+          Lex.getStrVal() == "DIExpression") {
+        if (ParseDIExpression(N, /*IsDistinct=*/false))
+          return true;
+      } else if (ParseToken(lltok::exclaim, "Expected '!' here") ||
+                 ParseMDNodeID(N)) {
+        return true;
+      }
       NMD->addOperand(N);
     } while (EatIfPresent(lltok::comma));
 
index 58a655a4dee4fe44f22309550de7aa750f983d04..25f48368af5a9d7f88afbbbde7f3631eb2ff6be0 100644 (file)
@@ -490,6 +490,7 @@ static MIToken::TokenKind getMetadataKeywordKind(StringRef Identifier) {
       .Case("!alias.scope", MIToken::md_alias_scope)
       .Case("!noalias", MIToken::md_noalias)
       .Case("!range", MIToken::md_range)
+      .Case("!DIExpression", MIToken::md_diexpr)
       .Default(MIToken::Error);
 }
 
index 08b82e59c4fc131bb606f823e75455ae541bd51b..c203d2c4817bc9281f407206d0668384b8319b97 100644 (file)
@@ -100,6 +100,7 @@ struct MIToken {
     md_alias_scope,
     md_noalias,
     md_range,
+    md_diexpr,
 
     // Identifier tokens
     Identifier,
index c68d87b15a3176597fbb849edad343b7b70ed72c..5d68d4463a6a1e005b8ebb3a1e3c0dc759297ca9 100644 (file)
@@ -39,6 +39,7 @@
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DataLayout.h"
+#include "llvm/IR/DebugInfoMetadata.h"
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/InstrTypes.h"
@@ -209,6 +210,7 @@ public:
   bool parseJumpTableIndexOperand(MachineOperand &Dest);
   bool parseExternalSymbolOperand(MachineOperand &Dest);
   bool parseMDNode(MDNode *&Node);
+  bool parseDIExpression(MDNode *&Node);
   bool parseMetadataOperand(MachineOperand &Dest);
   bool parseCFIOffset(int &Offset);
   bool parseCFIRegister(unsigned &Reg);
@@ -854,10 +856,14 @@ bool MIParser::parseStandaloneStackObject(int &FI) {
 
 bool MIParser::parseStandaloneMDNode(MDNode *&Node) {
   lex();
-  if (Token.isNot(MIToken::exclaim))
+  if (Token.is(MIToken::exclaim)) {
+    if (parseMDNode(Node))
+      return true;
+  } else if (Token.is(MIToken::md_diexpr)) {
+    if (parseDIExpression(Node))
+      return true;
+  } else
     return error("expected a metadata node");
-  if (parseMDNode(Node))
-    return true;
   if (Token.isNot(MIToken::Eof))
     return error("expected end of string after the metadata node");
   return false;
@@ -1492,6 +1498,7 @@ bool MIParser::parseSubRegisterIndexOperand(MachineOperand &Dest) {
 
 bool MIParser::parseMDNode(MDNode *&Node) {
   assert(Token.is(MIToken::exclaim));
+
   auto Loc = Token.location();
   lex();
   if (Token.isNot(MIToken::IntegerLiteral) || Token.integerValue().isSigned())
@@ -1507,10 +1514,56 @@ bool MIParser::parseMDNode(MDNode *&Node) {
   return false;
 }
 
+bool MIParser::parseDIExpression(MDNode *&Expr) {
+  assert(Token.is(MIToken::md_diexpr));
+  lex();
+
+  // FIXME: Share this parsing with the IL parser.
+  SmallVector<uint64_t, 8> Elements;
+
+  if (expectAndConsume(MIToken::lparen))
+    return true;
+
+  if (Token.isNot(MIToken::rparen)) {
+    do {
+      if (Token.is(MIToken::Identifier)) {
+        if (unsigned Op = dwarf::getOperationEncoding(Token.stringValue())) {
+          lex();
+          Elements.push_back(Op);
+          continue;
+        }
+        return error(Twine("invalid DWARF op '") + Token.stringValue() + "'");
+      }
+
+      if (Token.isNot(MIToken::IntegerLiteral) ||
+          Token.integerValue().isSigned())
+        return error("expected unsigned integer");
+
+      auto &U = Token.integerValue();
+      if (U.ugt(UINT64_MAX))
+        return error("element too large, limit is " + Twine(UINT64_MAX));
+      Elements.push_back(U.getZExtValue());
+      lex();
+
+    } while (consumeIfPresent(MIToken::comma));
+  }
+
+  if (expectAndConsume(MIToken::rparen))
+    return true;
+
+  Expr = DIExpression::get(MF.getFunction()->getContext(), Elements);
+  return false;
+}
+
 bool MIParser::parseMetadataOperand(MachineOperand &Dest) {
   MDNode *Node = nullptr;
-  if (parseMDNode(Node))
-    return true;
+  if (Token.is(MIToken::exclaim)) {
+    if (parseMDNode(Node))
+      return true;
+  } else if (Token.is(MIToken::md_diexpr)) {
+    if (parseDIExpression(Node))
+      return true;
+  }
   Dest = MachineOperand::CreateMetadata(Node);
   return false;
 }
@@ -1851,6 +1904,7 @@ bool MIParser::parseMachineOperand(MachineOperand &Dest,
     return parseExternalSymbolOperand(Dest);
   case MIToken::SubRegisterIndex:
     return parseSubRegisterIndexOperand(Dest);
+  case MIToken::md_diexpr:
   case MIToken::exclaim:
     return parseMetadataOperand(Dest);
   case MIToken::kw_cfi_same_value:
index 170bc544d53f8a5c88fc2b45e4d9fec048c144da..1cd6dd0ddff4f96dfa99b08223a0b888f1f33346 100644 (file)
@@ -1046,6 +1046,10 @@ void SlotTracker::CreateFunctionSlot(const Value *V) {
 void SlotTracker::CreateMetadataSlot(const MDNode *N) {
   assert(N && "Can't insert a null Value into SlotTracker!");
 
+  // Don't make slots for DIExpressions. We just print them inline everywhere.
+  if (isa<DIExpression>(N))
+    return;
+
   unsigned DestSlot = mdnNext;
   if (!mdnMap.insert(std::make_pair(N, DestSlot)).second)
     return;
@@ -2073,6 +2077,13 @@ static void WriteAsOperandInternal(raw_ostream &Out, const Metadata *MD,
                                    TypePrinting *TypePrinter,
                                    SlotTracker *Machine, const Module *Context,
                                    bool FromValue) {
+  // Write DIExpressions inline when used as a value. Improves readability of
+  // debug info intrinsics.
+  if (const DIExpression *Expr = dyn_cast<DIExpression>(MD)) {
+    writeDIExpression(Out, Expr, TypePrinter, Machine, Context);
+    return;
+  }
+
   if (const MDNode *N = dyn_cast<MDNode>(MD)) {
     std::unique_ptr<SlotTracker> MachineStorage;
     if (!Machine) {
@@ -2424,7 +2435,16 @@ void AssemblyWriter::printNamedMDNode(const NamedMDNode *NMD) {
   for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
     if (i)
       Out << ", ";
-    int Slot = Machine.getMetadataSlot(NMD->getOperand(i));
+
+    // Write DIExpressions inline.
+    // FIXME: Ban DIExpressions in NamedMDNodes, they will serve no purpose.
+    MDNode *Op = NMD->getOperand(i);
+    if (auto *Expr = dyn_cast<DIExpression>(Op)) {
+      writeDIExpression(Out, Expr, nullptr, nullptr, nullptr);
+      continue;
+    }
+
+    int Slot = Machine.getMetadataSlot(Op);
     if (Slot == -1)
       Out << "<badref>";
     else
index 19f3d1443bff38b87dbdf7af112aa317c787b923..148b7eb6633544d3468743a5acb6b4a28ddfc763 100644 (file)
@@ -3,7 +3,7 @@
 
 @foo = global i32 0
 
-; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7}
+; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !DIExpression(DW_OP_constu, 42, DW_OP_stack_value)}
 !named = !{!0, !1, !2, !3, !4, !5, !6, !7}
 
 !0 = !DIFile(filename: "scope.h", directory: "/path/to/dir")
@@ -17,7 +17,6 @@
                        file: !2, line: 7, type: !3, isLocal: true,
                        isDefinition: false, align: 32)
 
-; CHECK: !6 = !DIGlobalVariableExpression(var: !5, expr: !7)
+; CHECK: !6 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression(DW_OP_constu, 42, DW_OP_stack_value))
 !6 = !DIGlobalVariableExpression(var: !5, expr: !7)
-; CHECK: !7 = !DIExpression(DW_OP_constu, 42, DW_OP_stack_value)
 !7 = !DIExpression(DW_OP_constu, 42, DW_OP_stack_value)
index 39f4be70145af3cc7b43e41d416f2684db48e534..b6d2cc2dc57659140a996ba8e09a0ce73f1a3369 100644 (file)
@@ -1,16 +1,17 @@
 ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
 ; RUN: verify-uselistorder %s
 
-; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6}
+; CHECK: !named = !{
+; CHECK-SAME: !DIExpression(),
+; CHECK-SAME: !DIExpression(DW_OP_deref),
+; CHECK-SAME: !DIExpression(DW_OP_constu, 3, DW_OP_plus),
+; CHECK-SAME: !DIExpression(DW_OP_LLVM_fragment, 3, 7),
+; CHECK-SAME: !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 3, DW_OP_LLVM_fragment, 3, 7),
+; CHECK-SAME: !DIExpression(DW_OP_constu, 2, DW_OP_swap, DW_OP_xderef),
+; CHECK-SAME: !DIExpression(DW_OP_plus_uconst, 3)}
+
 !named = !{!0, !1, !2, !3, !4, !5, !6}
 
-; CHECK:      !0 = !DIExpression()
-; CHECK-NEXT: !1 = !DIExpression(DW_OP_deref)
-; CHECK-NEXT: !2 = !DIExpression(DW_OP_constu, 3, DW_OP_plus)
-; CHECK-NEXT: !3 = !DIExpression(DW_OP_LLVM_fragment, 3, 7)
-; CHECK-NEXT: !4 = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 3, DW_OP_LLVM_fragment, 3, 7)
-; CHECK-NEXT: !5 = !DIExpression(DW_OP_constu, 2, DW_OP_swap, DW_OP_xderef)
-; CHECK-NEXT: !6 = !DIExpression(DW_OP_plus_uconst, 3)
 !0 = !DIExpression()
 !1 = !DIExpression(DW_OP_deref)
 !2 = !DIExpression(DW_OP_constu, 3, DW_OP_plus)
index 50d6943dead801aea846bd4ca8932ac827c795e8..92c39ac7a6c381b7ad92b4cf462d8aacaae5ab28 100644 (file)
@@ -1,9 +1,8 @@
 ; RUN: not llvm-as -disable-output < %s 2>&1 | FileCheck -check-prefix VERIFY %s
 ; RUN: llvm-as -disable-verify < %s | llvm-dis | FileCheck -check-prefix NOVERIFY %s
 
-; NOVERIFY: !named = !{!0}
+; NOVERIFY: !named = !{!DIExpression(0, 1, 9, 7, 2)}
 !named = !{!0}
 
-; NOVERIFY: !0 = !DIExpression(0, 1, 9, 7, 2)
 ; VERIFY: assembly parsed, but does not verify
 !0 = !DIExpression(0, 1, 9, 7, 2)
index 5ce936d7074da2f7434a9d20148d744b862372cb..27298710adbcd60b6b01b4cfc0c374b09150305c 100644 (file)
@@ -2,8 +2,7 @@
 %class.A = type { i32, i32, i32, i32 }
 
 define void @_Z3fooi(%class.A* sret %agg.result) #0 !dbg !3 {
-  ; CHECK: call void @llvm.dbg.declare({{.*}}, metadata ![[EXPR:[0-9]+]]), !dbg
-  ; CHECK: ![[EXPR]] = !DIExpression()
+  ; CHECK: call void @llvm.dbg.declare({{.*}}, metadata !DIExpression()), !dbg
   call void @llvm.dbg.declare(metadata %class.A* %agg.result, metadata !13, metadata !16), !dbg !17
   ret void, !dbg !17
 }
index 3cf082472829e476fc938dd96613a1999dc1daa9..d6ff13907170395f86c8f3794b82cfb8959fecec 100644 (file)
@@ -5,16 +5,14 @@
 ; BC: GLOBAL_DECL_ATTACHMENT
 ; CHECK: @g = common global i32 0, align 4, !dbg ![[G:[0-9]+]]
 ; CHECK: @h = common global i32 0, align 4, !dbg ![[H:[0-9]+]]
-; CHECK: ![[G]] = {{.*}}!DIGlobalVariableExpression(var: ![[GVAR:[0-9]+]], expr: ![[GEXPR:[0-9]+]])
+; CHECK: ![[G]] = {{.*}}!DIGlobalVariableExpression(var: ![[GVAR:[0-9]+]], expr: !DIExpression(DW_OP_plus_uconst, 1))
 ; CHECK: ![[GVAR]] = distinct !DIGlobalVariable(name: "g",
 ; CHECK: DICompileUnit({{.*}}, imports: ![[IMPORTS:[0-9]+]]
-; CHECK: !DIGlobalVariableExpression(var: ![[CVAR:[0-9]+]], expr: ![[CEXPR:[0-9]+]])
+; CHECK: !DIGlobalVariableExpression(var: ![[CVAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 23, DW_OP_stack_value))
 ; CHECK: ![[CVAR]] = distinct !DIGlobalVariable(name: "c",
-; CHECK: ![[CEXPR]] = !DIExpression(DW_OP_constu, 23, DW_OP_stack_value)
 ; CHECK: ![[HVAR:[0-9]+]] = distinct !DIGlobalVariable(name: "h",
 ; CHECK: ![[IMPORTS]] = !{![[CIMPORT:[0-9]+]]}
 ; CHECK: ![[CIMPORT]] = !DIImportedEntity({{.*}}entity: ![[HVAR]]
-; CHECK: ![[GEXPR]] = !DIExpression(DW_OP_plus_uconst, 1)
 ; CHECK: ![[H]] = {{.*}}!DIGlobalVariableExpression(var: ![[HVAR]])
 
 @g = common global i32 0, align 4, !dbg !0
index f00a2dd86f74361c71477767ab831e9c1ba6b2ac..9a904c7aff788b0093ff18c98168d5680ef3ff88 100644 (file)
@@ -9,9 +9,8 @@
 !2 = !{}
 ; CHECK: !3 = !{!4}
 !3 = !{!4}
-; CHECK: !4 = {{.*}}!DIGlobalVariableExpression(var: !5, expr: !8)
+; CHECK: !4 = {{.*}}!DIGlobalVariableExpression(var: !5, expr: !DIExpression(DW_OP_constu, 42, DW_OP_stack_value))
 ; CHECK: !5 = !DIGlobalVariable(name: "c", scope: !0, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true)
-; CHECK: !8 = !DIExpression(DW_OP_constu, 42, DW_OP_stack_value)
 !4 = !DIGlobalVariable(name: "c", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32 42)
 !5 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !6)
 !6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
index 5b6ffb6d3e8834f1bfb45ff452b7ef88f12811da..2a3a6369ae85bd5400aa289d69b25d8b914fbee0 100644 (file)
@@ -6,7 +6,7 @@
 define void @f() !dbg !3 {
 entry:
   ; CHECK-NOT: call void @llvm.dbg.value
-  ; CHECK: call void @llvm.dbg.value(metadata i32 42, metadata !8, metadata !9), !dbg !10
+  ; CHECK: call void @llvm.dbg.value(metadata i32 42, metadata !8, metadata !DIExpression())
   call void @llvm.dbg.value(metadata i32 42, i64 0, metadata !8, metadata !9), !dbg !10
   ; CHECK-NOT: call void @llvm.dbg.value
   call void @llvm.dbg.value(metadata i32 0, i64 1, metadata !8, metadata !9), !dbg !10
index e832ba953241784e086176bb7e31e95d8396755f..cd32cb41c7c0b13ff1a7ffde03f7aa805787e504 100644 (file)
@@ -4,41 +4,41 @@
 ; CHECK-LABEL: name: debug_declare
 ; CHECK: stack:
 ; CHECK:    - { id: {{.*}}, name: in.addr, type: default, offset: 0, size: {{.*}}, alignment: {{.*}}, 
-; CHECK-NEXT: callee-saved-register: '', di-variable: '!11', di-expression: '!12',
-; CHECK: DBG_VALUE debug-use %0(s32), debug-use _, !11, !12, debug-location !13
+; CHECK-NEXT: callee-saved-register: '', di-variable: '!11', di-expression: '!DIExpression()',
+; CHECK: DBG_VALUE debug-use %0(s32), debug-use _, !11, !DIExpression(), debug-location !12
 define void @debug_declare(i32 %in) #0 !dbg !7 {
 entry:
   %in.addr = alloca i32, align 4
   store i32 %in, i32* %in.addr, align 4
-  call void @llvm.dbg.declare(metadata i32* %in.addr, metadata !11, metadata !12), !dbg !13
-  call void @llvm.dbg.declare(metadata i32 %in, metadata !11, metadata !12), !dbg !13
-  ret void, !dbg !13
+  call void @llvm.dbg.declare(metadata i32* %in.addr, metadata !11, metadata !DIExpression()), !dbg !12
+  call void @llvm.dbg.declare(metadata i32 %in, metadata !11, metadata !DIExpression()), !dbg !12
+  ret void, !dbg !12
 }
 
 ; CHECK-LABEL: name: debug_declare_vla
-; CHECK: DBG_VALUE debug-use %{{[0-9]+}}(p0), debug-use _, !15, !12, debug-location !16
-define void @debug_declare_vla(i32 %in) #0 !dbg !14 {
+; CHECK: DBG_VALUE debug-use %{{[0-9]+}}(p0), debug-use _, !14, !DIExpression(), debug-location !15
+define void @debug_declare_vla(i32 %in) #0 !dbg !13 {
 entry:
   %vla.addr = alloca i32, i32 %in
-  call void @llvm.dbg.declare(metadata i32* %vla.addr, metadata !15, metadata !12), !dbg !16
-  ret void, !dbg !16
+  call void @llvm.dbg.declare(metadata i32* %vla.addr, metadata !14, metadata !DIExpression()), !dbg !15
+  ret void, !dbg !15
 }
 
 ; CHECK-LABEL: name: debug_value
 ; CHECK: [[IN:%[0-9]+]](s32) = COPY %w0
-define void @debug_value(i32 %in) #0 !dbg !17 {
+define void @debug_value(i32 %in) #0 !dbg !16 {
   %addr = alloca i32
-; CHECK: DBG_VALUE debug-use [[IN]](s32), debug-use _, !18, !12, debug-location !19
-  call void @llvm.dbg.value(metadata i32 %in, i64 0, metadata !18, metadata !12), !dbg !19
+; CHECK: DBG_VALUE debug-use [[IN]](s32), debug-use _, !17, !DIExpression(), debug-location !18
+  call void @llvm.dbg.value(metadata i32 %in, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
   store i32 %in, i32* %addr
-; CHECK: DBG_VALUE debug-use %1(p0), debug-use _, !18, !20, debug-location !19
-  call void @llvm.dbg.value(metadata i32* %addr, i64 0, metadata !18, metadata !20), !dbg !19
-; CHECK: DBG_VALUE 123, 0, !18, !12, debug-location !19
-  call void @llvm.dbg.value(metadata i32 123, i64 0, metadata !18, metadata !12), !dbg !19
-; CHECK: DBG_VALUE float 1.000000e+00, 0, !18, !12, debug-location !19
-  call void @llvm.dbg.value(metadata float 1.000000e+00, i64 0, metadata !18, metadata !12), !dbg !19
-; CHECK: DBG_VALUE _, 0, !18, !12, debug-location !19
-  call void @llvm.dbg.value(metadata i32* null, i64 0, metadata !18, metadata !12), !dbg !19
+; CHECK: DBG_VALUE debug-use %1(p0), debug-use _, !17, !DIExpression(DW_OP_deref), debug-location !18
+  call void @llvm.dbg.value(metadata i32* %addr, i64 0, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
+; CHECK: DBG_VALUE 123, 0, !17, !DIExpression(), debug-location !18
+  call void @llvm.dbg.value(metadata i32 123, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
+; CHECK: DBG_VALUE float 1.000000e+00, 0, !17, !DIExpression(), debug-location !18
+  call void @llvm.dbg.value(metadata float 1.000000e+00, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
+; CHECK: DBG_VALUE _, 0, !17, !DIExpression(), debug-location !18
+  call void @llvm.dbg.value(metadata i32* null, i64 0, metadata !17, metadata !DIExpression()), !dbg !18
   ret void
 }
 
@@ -62,12 +62,10 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
 !9 = !{null, !10}
 !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
 !11 = !DILocalVariable(name: "in", arg: 1, scope: !7, file: !1, line: 1, type: !10)
-!12 = !DIExpression()
-!13 = !DILocation(line: 1, column: 14, scope: !7)
-!14 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!15 = !DILocalVariable(name: "in", arg: 1, scope: !14, file: !1, line: 1, type: !10)
-!16 = !DILocation(line: 1, column: 14, scope: !14)
-!17 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!18 = !DILocalVariable(name: "in", arg: 1, scope: !17, file: !1, line: 1, type: !10)
-!19 = !DILocation(line: 1, column: 14, scope: !17)
-!20 = !DIExpression(DW_OP_deref)
+!12 = !DILocation(line: 1, column: 14, scope: !7)
+!13 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
+!14 = !DILocalVariable(name: "in", arg: 1, scope: !13, file: !1, line: 1, type: !10)
+!15 = !DILocation(line: 1, column: 14, scope: !13)
+!16 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
+!17 = !DILocalVariable(name: "in", arg: 1, scope: !16, file: !1, line: 1, type: !10)
+!18 = !DILocation(line: 1, column: 14, scope: !16)
index c8a8266e8b2800da09996dd6c7d7879950a44f88..4282bffdab129cd9ba0d325c2aeb1bf6cc21dcae 100644 (file)
@@ -5,7 +5,7 @@
 
   define void @test_dbg_value() !dbg !5 {
     ; Keep the dbg metadata live by referencing it in the IR.
-    call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !7, metadata !9), !dbg !10
+    call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !7, metadata !DIExpression()), !dbg !9
     ret void
   }
 
@@ -23,8 +23,7 @@
   !6 = !DISubroutineType(types: !2)
   !7 = !DILocalVariable(name: "in", arg: 1, scope: !5, file: !1, line: 1, type: !8)
   !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-  !9 = !DIExpression()
-  !10 = !DILocation(line: 1, column: 1, scope: !5)
+  !9 = !DILocation(line: 1, column: 1, scope: !5)
 ...
 
 ---
@@ -37,9 +36,9 @@ body: |
   bb.0:
     liveins: %w0
     %0:_(s32) = COPY %w0
-    ; CHECK: DBG_VALUE debug-use %0(s32), debug-use _, !7, !9, debug-location !10
-    DBG_VALUE debug-use %0(s32), debug-use _, !7, !9, debug-location !10
+    ; CHECK: DBG_VALUE debug-use %0(s32), debug-use _, !7, !DIExpression(), debug-location !9
+    DBG_VALUE debug-use %0(s32), debug-use _, !7, !DIExpression(), debug-location !9
 
-    ; CHECK: DBG_VALUE _, 0, !7, !9, debug-location !10
-    DBG_VALUE _, 0, !7, !9, debug-location !10
+    ; CHECK: DBG_VALUE _, 0, !7, !DIExpression(), debug-location !9
+    DBG_VALUE _, 0, !7, !DIExpression(), debug-location !9
 ...
index 790cd6517dd3ac09c4107a0c66ae973415a286d8..96245e3ec625df02cba07d47def88c39b2222ce2 100644 (file)
@@ -5,12 +5,12 @@
 
   define void @test_dbg_value(i32 %a) !dbg !5 {
     %tmp0 = add i32 %a, %a
-    call void @llvm.dbg.value(metadata i32 %tmp0, i64 0, metadata !7, metadata !9), !dbg !10
+    call void @llvm.dbg.value(metadata i32 %tmp0, i64 0, metadata !7, metadata !DIExpression()), !dbg !9
     ret void
   }
 
-  define void @test_dbg_value_dead(i32 %a) !dbg !11 {
-    call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !12, metadata !9), !dbg !13
+  define void @test_dbg_value_dead(i32 %a) !dbg !10 {
+    call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !11, metadata !DIExpression()), !dbg !12
     ret void
   }
 
   !6 = !DISubroutineType(types: !2)
   !7 = !DILocalVariable(name: "in", arg: 1, scope: !5, file: !1, line: 1, type: !8)
   !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-  !9 = !DIExpression()
-  !10 = !DILocation(line: 1, column: 1, scope: !5)
-  !11 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-  !12 = !DILocalVariable(name: "in", arg: 1, scope: !11, file: !1, line: 1, type: !8)
-  !13 = !DILocation(line: 1, column: 1, scope: !11)
+  !9 = !DILocation(line: 1, column: 1, scope: !5)
+  !10 = distinct !DISubprogram(name: "test_dbg_value", scope: !1, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
+  !11 = !DILocalVariable(name: "in", arg: 1, scope: !10, file: !1, line: 1, type: !8)
+  !12 = !DILocation(line: 1, column: 1, scope: !10)
 ...
 
 ---
@@ -50,9 +49,9 @@ body: |
     ; CHECK:      %0 = COPY %w0
     ; CHECK-NEXT: %1 = ADDWrr %0, %0
     ; CHECK-NEXT: %w0 = COPY %1
-    ; CHECK-NEXT: DBG_VALUE debug-use %1, debug-use _, !7, !9, debug-location !10
+    ; CHECK-NEXT: DBG_VALUE debug-use %1, debug-use _, !7, !DIExpression(), debug-location !9
 
-    DBG_VALUE debug-use %1(s32), debug-use _, !7, !9, debug-location !10
+    DBG_VALUE debug-use %1(s32), debug-use _, !7, !DIExpression(), debug-location !9
 ...
 
 ---
@@ -66,7 +65,7 @@ body: |
     %0:gpr(s32) = COPY %w0
 
     ; CHECK-NOT: COPY
-    ; CHECK: DBG_VALUE debug-use _, debug-use _, !7, !9, debug-location !10
+    ; CHECK: DBG_VALUE debug-use _, debug-use _, !7, !DIExpression(), debug-location !9
 
-    DBG_VALUE debug-use %0(s32), debug-use _, !7, !9, debug-location !10
+    DBG_VALUE debug-use %0(s32), debug-use _, !7, !DIExpression(), debug-location !9
 ...
index aa6cd5a0a45f6639b97acd22605fbfb3cb74523f..28809d3ee9072a5acfe2cba230a1539cc1e52c05 100644 (file)
@@ -8,18 +8,18 @@
   entry:
     %x.addr = alloca i32, align 4
     store i32 %x, i32* %x.addr, align 4
-    call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !13), !dbg !14
-    %0 = load i32, i32* %x.addr, align 4, !dbg !15
-    ret i32 %0, !dbg !15
+    call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !DIExpression()), !dbg !13
+    %0 = load i32, i32* %x.addr, align 4, !dbg !14
+    ret i32 %0, !dbg !14
   }
 
   define i32 @test_typed_immediates(i32 %x) #0 {
   entry:
     %x.addr = alloca i32, align 4
     store i32 %x, i32* %x.addr, align 4
-    call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !13), !dbg !14
-    %0 = load i32, i32* %x.addr, align 4, !dbg !15
-    ret i32 %0, !dbg !15
+    call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !DIExpression()), !dbg !13
+    %0 = load i32, i32* %x.addr, align 4, !dbg !14
+    ret i32 %0, !dbg !14
   }
 
   declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
@@ -43,9 +43,8 @@
   !10 = !{i32 2, !"Debug Info Version", i32 3}
   !11 = !{!"clang version 3.7.0"}
   !12 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !5, line: 4, type: !8)
-  !13 = !DIExpression()
-  !14 = !DILocation(line: 4, scope: !4)
-  !15 = !DILocation(line: 8, scope: !4)
+  !13 = !DILocation(line: 4, scope: !4)
+  !14 = !DILocation(line: 8, scope: !4)
 
 ...
 ---
@@ -60,14 +59,14 @@ stack:
 body: |
   bb.0.entry:
     liveins: %edi
-    ; CHECK: DBG_VALUE debug-use _, 0, !11, !12, debug-location !13
-    ; CHECK: %eax = COPY %0, debug-location !14
-    ; CHECK: RETQ %eax, debug-location !14
+    ; CHECK: DBG_VALUE debug-use _, 0, !11, !DIExpression(), debug-location !12
+    ; CHECK: %eax = COPY %0, debug-location !13
+    ; CHECK: RETQ %eax, debug-location !13
     %0 = COPY %edi
-    DBG_VALUE debug-use _, 0, !12, !13, debug-location !14
+    DBG_VALUE debug-use _, 0, !12, !DIExpression(), debug-location !13
     MOV32mr %stack.0.x.addr, 1, _, 0, _, %0
-    %eax = COPY %0, debug-location !15
-    RETQ %eax, debug-location !15
+    %eax = COPY %0, debug-location !14
+    RETQ %eax, debug-location !14
 ...
 ---
 name:            test_typed_immediates
@@ -83,12 +82,12 @@ body: |
     liveins: %edi
 
     %0 = COPY %edi
-  ; CHECK:      DBG_VALUE _, i32 0, !11, !12
-  ; CHECK-NEXT: DBG_VALUE _, i64 -22, !11, !12
-  ; CHECK-NEXT: DBG_VALUE _, i128 123492148938512984928424384934328985928, !11, !12
-    DBG_VALUE _, i32 0, !12, !13
-    DBG_VALUE _, i64 -22, !12, !13
-    DBG_VALUE _, i128 123492148938512984928424384934328985928, !12, !13
+  ; CHECK:      DBG_VALUE _, i32 0, !DIExpression(), !12
+  ; CHECK-NEXT: DBG_VALUE _, i64 -22, !DIExpression(), !12
+  ; CHECK-NEXT: DBG_VALUE _, i128 123492148938512984928424384934328985928, !DIExpression(), !12
+    DBG_VALUE _, i32 0, !DIExpression(), !13
+    DBG_VALUE _, i64 -22, !DIExpression(), !13
+    DBG_VALUE _, i128 123492148938512984928424384934328985928, !DIExpression(), !13
     MOV32mr %stack.0.x.addr, 1, _, 0, _, %0
     %eax = COPY %0
     RETQ %eax
index 9d92fe5c2c6d958fb9c4d831f6d8cec12b51d71b..758f3031465bca23b8b7a471c3faba221eb18f5a 100644 (file)
@@ -8,9 +8,9 @@
   entry:
     %x.addr = alloca i32, align 4
     store i32 %x, i32* %x.addr, align 4
-    call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !13), !dbg !14
-    %0 = load i32, i32* %x.addr, align 4, !dbg !15
-    ret i32 %0, !dbg !15
+    call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !12, metadata !DIExpression()), !dbg !13
+    %0 = load i32, i32* %x.addr, align 4, !dbg !14
+    ret i32 %0, !dbg !14
   }
 
   declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
@@ -34,9 +34,8 @@
   !10 = !{i32 2, !"Debug Info Version", i32 3}
   !11 = !{!"clang version 3.7.0"}
   !12 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !5, line: 4, type: !8)
-  !13 = !DIExpression()
-  !14 = !DILocation(line: 4, scope: !4)
-  !15 = !DILocation(line: 8, scope: !4)
+  !13 = !DILocation(line: 4, scope: !4)
+  !14 = !DILocation(line: 8, scope: !4)
 
 ...
 ---
@@ -52,9 +51,9 @@ body: |
   bb.0.entry:
     liveins: %edi
     ; CHECK:      %0 = COPY %edi
-    ; CHECK-NEXT: DBG_VALUE _, 0, !11, !12
+    ; CHECK-NEXT: DBG_VALUE _, 0, !11, !DIExpression()
     %0 = COPY %edi
-    DBG_VALUE _, 0, !12, ! 13
+    DBG_VALUE _, 0, !12, !DIExpression()
     MOV32mr %stack.0.x.addr, 1, _, 0, _, %0
     %eax = COPY %0
     RETQ %eax
index 445d1bd3f1fde98b12949836ae817289d7d93781..5c70582233e52754cbfe53625ba8ac349f487e6b 100644 (file)
@@ -15,7 +15,7 @@
     %1 = bitcast [256 x i8]* %y.i to i8*
     call void @llvm.lifetime.end(i64 -1, i8* %1) #3
     call void @llvm.lifetime.start(i64 -1, i8* %0) #3
-    call void @llvm.dbg.declare(metadata i8* %0, metadata !4, metadata !7) #3, !dbg !8
+    call void @llvm.dbg.declare(metadata i8* %0, metadata !4, metadata !DIExpression()) #3, !dbg !7
     br label %for.body
   }
 
   !1 = !DIFile(filename: "t.c", directory: "")
   !2 = !{}
   !3 = !{i32 1, !"Debug Info Version", i32 3}
-  !4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !9)
+  !4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !8)
   !5 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0)
   !6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
-  !7 = !DIExpression()
-  !8 = !DILocation(line: 0, scope: !5)
-  !9 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 2048, align: 8, elements: !10)
-  !10 = !{!11}
-  !11 = !DISubrange(count: 256)
+  !7 = !DILocation(line: 0, scope: !5)
+  !8 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 2048, align: 8, elements: !9)
+  !9 = !{!10}
+  !10 = !DISubrange(count: 256)
 ...
 ---
 name:            foo
@@ -52,17 +51,17 @@ frameInfo:
 # CHECK-LABEL: foo
 # CHECK: stack:
 # CHECK:  - { id: 0, name: y.i, type: default, offset: 0, size: 256, alignment: 16,
-# CHECK-NEXT: callee-saved-register: '', di-variable: '!4', di-expression: '!10',
-# CHECK-NEXT: di-location: '!11' }
+# CHECK-NEXT: callee-saved-register: '', di-variable: '!4', di-expression: '!DIExpression()',
+# CHECK-NEXT: di-location: '!10' }
 stack:
   - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4',
-      di-expression: '!7', di-location: '!8' }
+      di-expression: '!DIExpression()', di-location: '!7' }
 body: |
   bb.0.entry:
     successors: %bb.1.for.body
   bb.1.for.body:
     successors: %bb.1.for.body
 
-    DBG_VALUE %stack.0.y.i, 0, !4, !7, debug-location !8
+    DBG_VALUE %stack.0.y.i, 0, !4, !DIExpression(), debug-location !7
     JMP_1 %bb.1.for.body
 ...
index 03a745888b5a032e7581140508056814c5761b11..5a32d7e0815850ff28f53f766de7681892965d18 100644 (file)
   @d = common local_unnamed_addr global i32 0, align 4
   @b = common local_unnamed_addr global i32 0, align 4
 
-  define i32 @fn1() local_unnamed_addr !dbg !9 {
-    %1 = load %struct.A*, %struct.A** @c, align 8, !dbg !14
-    %2 = load i32, i32* @a, align 4, !dbg !14
-    %3 = sext i32 %2 to i64, !dbg !14
-    %4 = getelementptr inbounds %struct.A, %struct.A* %1, i64 %3, !dbg !14
-    %5 = ptrtoint %struct.A* %4 to i64, !dbg !14
-    %6 = trunc i64 %5 to i32, !dbg !14
-    store i32 %6, i32* @d, align 4, !dbg !14
-    %7 = getelementptr inbounds %struct.A, %struct.A* %1, i64 %3, i32 2, !dbg !15
-    tail call void @llvm.dbg.value(metadata i32* %7, i64 0, metadata !12, metadata !16), !dbg !17
-    br label %8, !dbg !18
+  define i32 @fn1() local_unnamed_addr !dbg !8 {
+    %1 = load %struct.A*, %struct.A** @c, align 8, !dbg !13
+    %2 = load i32, i32* @a, align 4, !dbg !13
+    %3 = sext i32 %2 to i64, !dbg !13
+    %4 = getelementptr inbounds %struct.A, %struct.A* %1, i64 %3, !dbg !13
+    %5 = ptrtoint %struct.A* %4 to i64, !dbg !13
+    %6 = trunc i64 %5 to i32, !dbg !13
+    store i32 %6, i32* @d, align 4, !dbg !13
+    %7 = getelementptr inbounds %struct.A, %struct.A* %1, i64 %3, i32 2, !dbg !14
+    tail call void @llvm.dbg.value(metadata i32* %7, i64 0, metadata !11, metadata !DIExpression()), !dbg !15
+    br label %8, !dbg !16
 
   ; <label>:8:                                      ; preds = %8, %0
-    %9 = load i32, i32* %7, align 4, !dbg !19
-    store i32 %9, i32* @d, align 4, !dbg !19
-    br label %8, !dbg !20
+    %9 = load i32, i32* %7, align 4, !dbg !17
+    store i32 %9, i32* @d, align 4, !dbg !17
+    br label %8, !dbg !18
   }
 
   ; Function Attrs: nounwind readnone
@@ -39,7 +39,6 @@
 
   !llvm.dbg.cu = !{!0}
   !llvm.module.flags = !{!5, !6, !7}
-  !misc = !{!8}
 
   !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !2)
   !1 = !DIFile(filename: "test.c", directory: "")
   !5 = !{i32 2, !"Dwarf Version", i32 4}
   !6 = !{i32 2, !"Debug Info Version", i32 3}
   !7 = !{i32 1, !"PIC Level", i32 2}
-  !8 = !DIExpression(DW_OP_plus_uconst, 8, DW_OP_stack_value)
-  !9 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 7, type: !10, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: true, unit: !0, variables: !11)
-  !10 = !DISubroutineType(types: !3)
-  !11 = !{!12}
-  !12 = !DILocalVariable(name: "e", scope: !9, file: !1, line: 8, type: !13)
-  !13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64)
-  !14 = !DILocation(line: 9, scope: !9)
-  !15 = !DILocation(line: 10, scope: !9)
-  !16 = !DIExpression()
-  !17 = !DILocation(line: 8, scope: !9)
-  !18 = !DILocation(line: 11, scope: !9)
-  !19 = !DILocation(line: 13, scope: !9)
-  !20 = !DILocation(line: 14, scope: !9)
+  !8 = distinct !DISubprogram(name: "fn1", scope: !1, file: !1, line: 7, type: !9, isLocal: false, isDefinition: true, scopeLine: 7, isOptimized: true, unit: !0, variables: !10)
+  !9 = !DISubroutineType(types: !3)
+  !10 = !{!11}
+  !11 = !DILocalVariable(name: "e", scope: !8, file: !1, line: 8, type: !12)
+  !12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64)
+  !13 = !DILocation(line: 9, scope: !8)
+  !14 = !DILocation(line: 10, scope: !8)
+  !15 = !DILocation(line: 8, scope: !8)
+  !16 = !DILocation(line: 11, scope: !8)
+  !17 = !DILocation(line: 13, scope: !8)
+  !18 = !DILocation(line: 14, scope: !8)
 
 ...
 ---
@@ -98,28 +95,28 @@ body:             |
   bb.0 (%ir-block.0):
     successors: %bb.1(0x80000000)
 
-    ; CHECK: %3 = LEA64r %2, 2, %2, 0, _, debug-location !14
-    ; CHECK-NEXT: %4 = LEA64r %1, 4, %3, 0, _, debug-location !14
-    ; CHECK-NOT: %0 = LEA64r %1, 4, %3, 8, _, debug-location !15
-    ; CHECK: DBG_VALUE debug-use %4, debug-use _, !12, !8, debug-location !17
+    ; CHECK: %3 = LEA64r %2, 2, %2, 0, _, debug-location !13
+    ; CHECK-NEXT: %4 = LEA64r %1, 4, %3, 0, _, debug-location !13
+    ; CHECK-NOT: %0 = LEA64r %1, 4, %3, 8, _, debug-location !14
+    ; CHECK: DBG_VALUE debug-use %4, debug-use _, !11, !DIExpression(DW_OP_plus_uconst, 8, DW_OP_stack_value), debug-location !15
 
-    %1 = MOV64rm %rip, 1, _, @c, _, debug-location !14 :: (dereferenceable load 8 from @c)
-    %2 = MOVSX64rm32 %rip, 1, _, @a, _, debug-location !14 :: (dereferenceable load 4 from @a)
-    %3 = LEA64r %2, 2, %2, 0, _, debug-location !14
-    %4 = LEA64r %1, 4, %3, 0, _, debug-location !14
-    %5 = COPY %4.sub_32bit, debug-location !14
-    MOV32mr %rip, 1, _, @d, _, killed %5, debug-location !14 :: (store 4 into @d)
-    %0 = LEA64r %1, 4, %3, 8, _, debug-location !15
-    DBG_VALUE debug-use %0, debug-use _, !12, !16, debug-location !17
+    %1 = MOV64rm %rip, 1, _, @c, _, debug-location !13 :: (dereferenceable load 8 from @c)
+    %2 = MOVSX64rm32 %rip, 1, _, @a, _, debug-location !13 :: (dereferenceable load 4 from @a)
+    %3 = LEA64r %2, 2, %2, 0, _, debug-location !13
+    %4 = LEA64r %1, 4, %3, 0, _, debug-location !13
+    %5 = COPY %4.sub_32bit, debug-location !13
+    MOV32mr %rip, 1, _, @d, _, killed %5, debug-location !13 :: (store 4 into @d)
+    %0 = LEA64r %1, 4, %3, 8, _, debug-location !14
+    DBG_VALUE debug-use %0, debug-use _, !11, !DIExpression(), debug-location !15
 
     ; CHECK-LABEL: bb.1 (%ir-block.8):
-    ; CHECK: %6 = MOV32rm %4, 1, _, 8, _, debug-location !19 :: (load 4 from %ir.7)
+    ; CHECK: %6 = MOV32rm %4, 1, _, 8, _, debug-location !17 :: (load 4 from %ir.7)
 
   bb.1 (%ir-block.8):
     successors: %bb.1(0x80000000)
 
-    %6 = MOV32rm %0, 1, _, 0, _, debug-location !19 :: (load 4 from %ir.7)
-    MOV32mr %rip, 1, _, @d, _, killed %6, debug-location !19 :: (store 4 into @d)
-    JMP_1 %bb.1, debug-location !20
+    %6 = MOV32rm %0, 1, _, 0, _, debug-location !17 :: (load 4 from %ir.7)
+    MOV32mr %rip, 1, _, @d, _, killed %6, debug-location !17 :: (store 4 into @d)
+    JMP_1 %bb.1, debug-location !18
 
 ...
index ba5c85922c7ab0b9ed98d3afa4f38e9fcb8ccc21..efc384d36d09f25b1214752257a4ee819fede296 100644 (file)
   !47 = !DIBasicType(name: "long int", size: 64, encoding: DW_ATE_signed)
   !48 = !DILocation(line: 10, column: 8, scope: !40, inlinedAt: !45)
 
+# CHECK: ![[I_VAR:[0-9]+]] = !DILocalVariable(name: "i", {{.*}}line: 9, {{.*}})
+# CHECK: ![[I_LOC:[0-9]+]] = !DILocation(line: 9, column: 37, {{.*}})
+# CHECK: ![[J_VAR:[0-9]+]] = !DILocalVariable(name: "j", {{.*}}line: 10, {{.*}})
+# CHECK: ![[J_LOC:[0-9]+]] = !DILocation(line: 10, column: 8, {{.*}})
+
 ...
 ---
 name:            _ZN1sC2Ei
@@ -246,8 +251,8 @@ body:             |
     liveins: %esi, %rdi, %r14, %rbx, %rbp
 
     ; CHECK:      [[REGISTER:%r[a-z0-9]+]] = LEA64r {{%r[a-z0-9]+}}, 1, _, -20, _
-    ; CHECK-NEXT: DBG_VALUE debug-use [[REGISTER]], debug-use _, !46, !17, debug-location !48
-    ; CHECK-NEXT: DBG_VALUE debug-use [[REGISTER]], debug-use _, !39, !17, debug-location !44
+    ; CHECK-NEXT: DBG_VALUE debug-use [[REGISTER]], debug-use _, ![[J_VAR]], !DIExpression(), debug-location ![[J_LOC]]
+    ; CHECK-NEXT: DBG_VALUE debug-use [[REGISTER]], debug-use _, ![[I_VAR]], !DIExpression(), debug-location ![[I_LOC]]
 
     frame-setup PUSH64r killed %rbp, implicit-def %rsp, implicit %rsp
     CFI_INSTRUCTION def_cfa_offset 16
index 1e18686a4b478304295d4b3538c2db9ad0692f45..70b787d646f96154ac65507b57ef850304b4d428 100644 (file)
@@ -20,14 +20,14 @@ entry:
   ; no native double data type available.
   ; Test that debug info for both values survives:
   ; CHECK: call void @llvm.dbg.value(metadata i64 0,
-  ; CHECK-SAME:                      metadata ![[C:.*]], metadata ![[REAL:.*]])
+  ; CHECK-SAME:                      metadata ![[C:[^,]*]],
+  ; CHECK-SAME:                      metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64))
   store double 0.000000e+00, double* %c.imagp, align 8, !dbg !17
   ; CHECK: call void @llvm.dbg.value(metadata i64 0,
-  ; CHECK-SAME:                      metadata ![[C]], metadata ![[IMG:.*]])
+  ; CHECK-SAME:                      metadata ![[C]],
+  ; CHECK-SAME:                      metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64))
   ret void, !dbg !18
 }
-; CHECK: ![[REAL]] = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
-; CHECK: ![[IMG]] = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
 
 ; Function Attrs: nounwind readnone
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
index e48ee7479e67232ca7541a2c15fe95dc5562abb0..3404403d9c0548db6052ccc88d35bb7df6b6bee3 100644 (file)
@@ -24,11 +24,9 @@ target triple = "x86_64-apple-macosx10.12.0"
 ; CHECK: @array.0.0 = internal unnamed_addr global i32 0, align 16, !dbg ![[EL0:.*]]
 ; CHECK: @array.1.0 = internal unnamed_addr global i32 0, align 8, !dbg ![[EL1:.*]]
 ;
-; CHECK: ![[EL0]] = !DIGlobalVariableExpression(var: ![[VAR:.*]], expr: ![[EX1:.*]])
+; CHECK: ![[EL0]] = !DIGlobalVariableExpression(var: ![[VAR:.*]], expr: !DIExpression(DW_OP_LLVM_fragment, 0, 32))
 ; CHECK: ![[VAR]] = distinct !DIGlobalVariable(name: "array"
-; CHECK: ![[EX1]] = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
-; CHECK: ![[EL1]] = !DIGlobalVariableExpression(var: ![[VAR]], expr: ![[EX2:.*]])
-; CHECK: ![[EX2]] = !DIExpression(DW_OP_LLVM_fragment, 64, 32)
+; CHECK: ![[EL1]] = !DIGlobalVariableExpression(var: ![[VAR]], expr: !DIExpression(DW_OP_LLVM_fragment, 64, 32))
 
 
 ; Function Attrs: nounwind optsize ssp uwtable
index e17e8cf3cacfa6833b6c4afc3eb1df3c8254a5fb..13293f24ace29c0699d7e9985a149be62ae5ef85 100644 (file)
@@ -22,11 +22,9 @@ target triple = "x86_64-apple-macosx10.12.0"
 ; CHECK: @static_struct.0 = internal unnamed_addr global i32 0, align 8, !dbg ![[EL0:.*]]
 ; CHECK: @static_struct.1 = internal unnamed_addr global i64 0, align 8, !dbg ![[EL1:.*]]
 
-; CHECK: ![[EL0]] = !DIGlobalVariableExpression(var: ![[VAR:.*]], expr: ![[EX1:.*]])
+; CHECK: ![[EL0]] = !DIGlobalVariableExpression(var: ![[VAR:.*]], expr: !DIExpression(DW_OP_LLVM_fragment, 0, 32))
 ; CHECK: ![[VAR]] = distinct !DIGlobalVariable(name: "static_struct"
-; CHECK: ![[EX1]] = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
-; CHECK: ![[EL1]] = !DIGlobalVariableExpression(var: ![[VAR]], expr: ![[EX2:.*]])
-; CHECK: ![[EX2]] = !DIExpression(DW_OP_LLVM_fragment, 32, 64)
+; CHECK: ![[EL1]] = !DIGlobalVariableExpression(var: ![[VAR]], expr: !DIExpression(DW_OP_LLVM_fragment, 32, 64))
 
 @static_struct = internal global %struct.mystruct zeroinitializer, align 8, !dbg !0
 
index ceaec8d8568269f7114aeaf9811b444ca0312c40..fb30cbd430ba54f3892777edc08bb8bbde02d910 100644 (file)
 # with clang -g -O1 -c -emit-llvm LiveDebugValues-3preds.c -S -o live-debug-values-3preds.ll
 # then llc -stop-after stackmap-liveness live-debug-values-3preds.ll -o /dev/null > live-debug-values-3preds.mir
 
+# CHECK: ![[X_VAR:[0-9]+]] = !DILocalVariable(name: "x", {{.*}})
+# CHECK: ![[Y_VAR:[0-9]+]] = !DILocalVariable(name: "y", {{.*}})
+# CHECK: ![[Z_VAR:[0-9]+]] = !DILocalVariable(name: "z", {{.*}})
+
 # DBG_VALUE for variables "x", "y" and "z" are extended into BB#9 from its
 # predecessors BB#0, BB#2 and BB#8.
 # CHECK:      bb.9.for.end:
-# CHECK-DAG:  DBG_VALUE debug-use %edi, debug-use _, !11, !16, debug-location !17
-# CHECK-DAG:  DBG_VALUE debug-use %edx, debug-use _, !13, !16, debug-location !20
-# CHECK-DAG:  DBG_VALUE debug-use %esi, debug-use _, !12, !16, debug-location !18
+# CHECK-DAG:  DBG_VALUE debug-use %edi, debug-use _, ![[X_VAR]], !DIExpression(), debug-location !{{[0-9]+}}
+# CHECK-DAG:  DBG_VALUE debug-use %esi, debug-use _, ![[Y_VAR]], !DIExpression(), debug-location !{{[0-9]+}}
+# CHECK-DAG:  DBG_VALUE debug-use %edx, debug-use _, ![[Z_VAR]], !DIExpression(), debug-location !{{[0-9]+}}
 # CHECK:      RET
 
 --- |
index cb89572a042307dd408f5c15684c2941a081ddd4..8b7e94f96cbe6ad7ca5a752f06ba5c0c1387e3c6 100644 (file)
 # llc -stop-after=funclet-layout < spill1.ll > spill1.mir                
 #
 # Make sure that we generated DBG_VALUE instructions for the spills
-# GENERATE: ![[MINUS48:.*]] = !DIExpression(DW_OP_constu, 48, DW_OP_minus)
-# GENERATE: ![[MINUS52:.*]] = !DIExpression(DW_OP_constu, 52, DW_OP_minus)
-# GENERATE: ![[MINUS56:.*]] = !DIExpression(DW_OP_constu, 56, DW_OP_minus)
+# GENERATE: ![[INT0:[0-9]+]] = !DILocalVariable(name: "int0",{{.*}})
+# GENERATE: ![[INTB:[0-9]+]] = !DILocalVariable(name: "intb",{{.*}})
+# GENERATE: ![[INTD:[0-9]+]] = !DILocalVariable(name: "intd",{{.*}})
+#
 # GENERATE:      bb.1.if.end:
 # GENERATE:      MOV32mr %rbp, 1, _, -48, _, killed %edx :: (store 4 into %stack.5)
-# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, !29, ![[MINUS48]]
+# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, ![[INT0]], !DIExpression(DW_OP_constu, 48, DW_OP_minus)
 # GENERATE:      MOV32mr %rbp, 1, _, -52, _, killed %r8d :: (store 4 into %stack.4)
-# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, !35, ![[MINUS52]]
+# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, ![[INTB]], !DIExpression(DW_OP_constu, 52, DW_OP_minus)
 # GENERATE:      MOV32mr %rbp, 1, _, -56, _, killed %esi :: (store 4 into %stack.3)
-# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, !37, ![[MINUS56]]
+# GENERATE-NEXT: DBG_VALUE debug-use %rbp, 0, ![[INTD]], !DIExpression(DW_OP_constu, 56, DW_OP_minus)
 #
 # Check that the spill locations that are valid at the end of bb.1.if.end are
 # propagated to subsequent BBs.
 #
 # GENERATE:      bb.2.if.then4:
 # GENERATE-NOT:  bb.3:
-# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, !37, ![[MINUS56]]
-# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, !35, ![[MINUS52]]
+# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, ![[INTD]], !DIExpression(DW_OP_constu, 56, DW_OP_minus)
+# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, ![[INTB]], !DIExpression(DW_OP_constu, 52, DW_OP_minus)
 #
 # GENERATE:      bb.3:
 # GENERATE-NOT:  bb.4.if.end13:
-# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, !37, ![[MINUS56]]
-# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, !35, ![[MINUS52]]
+# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, ![[INTD]], !DIExpression(DW_OP_constu, 56, DW_OP_minus)
+# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, ![[INTB]], !DIExpression(DW_OP_constu, 52, DW_OP_minus)
 #
 # GENERATE:      bb.4.if.end13:
 # GENERATE-NOT:  bb.5.cleanup:
-# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, !37, ![[MINUS56]]
-# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, !35, ![[MINUS52]]
+# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, ![[INTD]], !DIExpression(DW_OP_constu, 56, DW_OP_minus)
+# GENERATE-DAG:  DBG_VALUE debug-use %rbp, 0, ![[INTB]], !DIExpression(DW_OP_constu, 52, DW_OP_minus)
 # 
 # Check that the spill location rbp-48 (the variable int0) is not propagated 
 # because int0 is redefined within the same basic block.
 #
 # TERMINATE:     bb.2.if.then4:
-# TERMINATE-NOT: DBG_VALUE debug-use %rbp, -48, !26, !38
+# TERMINATE-NOT: DBG_VALUE debug-use %rbp, -48,
 --- |
   ; ModuleID = '<stdin>'
   source_filename = "spill1.c"
index d9daa4617ae4e00dd844809377482204a28ed24a..e8e0777f4cdaa255867e0484c8de74d4afa5ebdd 100644 (file)
 
 # DBG_VALUE for variable "n" is extended into BB#5 from its predecessors BB#3
 # and BB#4.
+# CHECK: ![[N_VAR:[0-9]+]] = !DILocalVariable(name: "n",{{.*}})
+#
 # CHECK:      bb.5.if.end.7:
-# CHECK:        DBG_VALUE debug-use %ebx, debug-use _, !19, !20, debug-location !33
+# CHECK:        DBG_VALUE debug-use %ebx, debug-use _, ![[N_VAR]], !DIExpression(), debug-location !{{[0-9]+}}
 
 
 --- |
index 4c87543636d5624ca91e7201989a564935a4b105..b95b02aaf7acadff1a870492890c0699ef58e201 100644 (file)
   ; This test verifies that LiveDebugValues doesn't propagate DBG_VALUEs into
   ; basic blocks that are beyond the scope of the source variable.
   ;
+  ; CHECK: ![[F_SP:[0-9]+]] = distinct !DISubprogram(name: "f", {{.*}})
+  ; CHECK: ![[A_VAR:[0-9]+]] = !DILocalVariable(name: "a",{{.*}})
+  ; CHECK: ![[I_VAR:[0-9]+]] = !DILocalVariable(name: "i",{{.*}})
+  ; CHECK: ![[I_LOC:[0-9]+]] = !DILocation(line: 4, column: 14, scope: !{{[0-9]+}})
+  ; CHECK: ![[INLCS1:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS1:[0-9]+]])
+  ; CHECK: ![[CS1]] = distinct !DILocation(line: 5, column: 3, scope: !{{[0-9]+}})
+  ; CHECK: ![[INLCS2:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS2:[0-9]+]])
+  ; CHECK: ![[CS2]] = distinct !DILocation(line: 7, column: 5, scope: !{{[0-9]+}})
+  ; CHECK: ![[INLCS3:[0-9]+]] = !DILocation(line: 3, column: 41, scope: ![[F_SP]], inlinedAt: ![[CS3:[0-9]+]])
+  ; CHECK: ![[CS3]] = distinct !DILocation(line: 8, column: 3, scope: !{{[0-9]+}})
+  ;
   ; CHECK:  bb.1.if.then:
-  ; CHECK:      DBG_VALUE debug-use %ebx, debug-use _, !19, !13, debug-location !20
-  ; CHECK-NOT:  DBG_VALUE debug-use %ebx, debug-use _, !12, !13, debug-location !21
-  ; CHECK:      DBG_VALUE debug-use %ebx, debug-use _, !12, !13, debug-location !27
+  ; CHECK:      DBG_VALUE debug-use %ebx, debug-use _, ![[I_VAR]], !DIExpression(), debug-location ![[I_LOC]]
+  ; CHECK-NOT:  DBG_VALUE debug-use %ebx, debug-use _, ![[A_VAR]], !DIExpression(), debug-location
+  ; CHECK:      DBG_VALUE debug-use %ebx, debug-use _, ![[A_VAR]], !DIExpression(), debug-location ![[INLCS2]]
   ; CHECK: bb.2.if.end:
-  ; CHECK:     DBG_VALUE debug-use %ebx, debug-use _, !19, !13, debug-location !20
-  ; CHECK-NOT: DBG_VALUE debug-use %ebx, debug-use _, !12, !13, debug-location !21
-  ; CHECK:     DBG_VALUE debug-use %ebx, debug-use _, !12, !13, debug-location !31
+  ; CHECK:     DBG_VALUE debug-use %ebx, debug-use _, ![[I_VAR]], !DIExpression(), debug-location ![[I_LOC]]
+  ; CHECK-NOT: DBG_VALUE debug-use %ebx, debug-use _, ![[A_VAR]], !DIExpression(), debug-location
+  ; CHECK:     DBG_VALUE debug-use %ebx, debug-use _, ![[A_VAR]], !DIExpression(), debug-location ![[INLCS3]]
   ;
   ; ModuleID = 'livedebugvalues-limit.ll'
   source_filename = "livedebugvalues-limit.c"
index a4f5c05770fb05b70195beb04b0af2104ca119bd..1200aa058485cca0146aecf65719749ac1579adb 100644 (file)
 ;      return 0;
 ;    }
 ;
-; CHECK: ![[MDN1:[0-9]+]] = !DIExpression(DW_OP_LLVM_fragment, 32, 16)
-; CHECK: ![[MDN2:[0-9]+]] = !DIExpression(DW_OP_LLVM_fragment, 48, 16)
-; CHECK: ![[MDN3:[0-9]+]] = !DIExpression(DW_OP_LLVM_fragment, 0, 16)
-; CHECK: ![[MDN4:[0-9]+]] = !DIExpression(DW_OP_LLVM_fragment, 16, 16)
-; CHECK-DAG: DBG_VALUE debug-use %r{{[0-9]+}}, debug-use _, !{{[0-9]+}}, ![[MDN1]], debug-location !{{[0-9]+}}
-; CHECK-DAG: DBG_VALUE debug-use %r{{[0-9]+}}, debug-use _, !{{[0-9]+}}, ![[MDN2]], debug-location !{{[0-9]+}}
-; CHECK-DAG: DBG_VALUE debug-use %r{{[0-9]+}}, debug-use _, !{{[0-9]+}}, ![[MDN3]], debug-location !{{[0-9]+}}
-; CHECK-DAG: DBG_VALUE debug-use %r{{[0-9]+}}, debug-use _, !{{[0-9]+}}, ![[MDN4]], debug-location !{{[0-9]+}}
+; CHECK-DAG: DBG_VALUE debug-use %r{{[0-9]+}}, debug-use _, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 32, 16), debug-location !{{[0-9]+}}
+; CHECK-DAG: DBG_VALUE debug-use %r{{[0-9]+}}, debug-use _, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 48, 16), debug-location !{{[0-9]+}}
+; CHECK-DAG: DBG_VALUE debug-use %r{{[0-9]+}}, debug-use _, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 0, 16), debug-location !{{[0-9]+}}
+; CHECK-DAG: DBG_VALUE debug-use %r{{[0-9]+}}, debug-use _, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 16, 16), debug-location !{{[0-9]+}}
 
 ; ModuleID = 'sdagsplit-1.c'
 target datalayout = "e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16"
index 60a486ff81bf407d9612bcd2ee329923c6be6ebd..343b2668801884dc41cded93020585daa8b38668 100644 (file)
@@ -16,9 +16,8 @@
 ; Test that we correctly lower dbg.declares for arrays.
 ;
 ; CHECK: define i32 @main
-; CHECK: call void @llvm.dbg.value(metadata i32 42, metadata ![[ARRAY:[0-9]+]], metadata ![[EXPR:[0-9]+]])
+; CHECK: call void @llvm.dbg.value(metadata i32 42, metadata ![[ARRAY:[0-9]+]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32))
 ; CHECK: ![[ARRAY]] = !DILocalVariable(name: "array",{{.*}} line: 6
-; CHECK: ![[EXPR]] = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.9.0"
 
index d9d0b1707dfd0e67a2bb2dcaac66d1d95bcc16c6..4cb99410dd6fe28fe51aa6fc508302be1cb83e1e 100644 (file)
@@ -9,11 +9,10 @@
 ;     ++x;
 ;   return x; // check that x is not a constant here.
 ; }
-; CHECK: ![[EXPR:.*]] = !DIExpression(DW_OP_plus_uconst, 4, DW_OP_deref)
 ; CHECK: ![[X:.*]] = !DILocalVariable(name: "x",
 ; CHECK: bb.0.entry:
 ; CHECK:   DBG_VALUE 23, 0, ![[X]],
-; CHECK:   DBG_VALUE %rsp, 0, ![[X]], ![[EXPR]],
+; CHECK:   DBG_VALUE %rsp, 0, ![[X]], !DIExpression(DW_OP_plus_uconst, 4, DW_OP_deref),
 ; CHECK: bb.1.if.then:
 ; CHECK:   DBG_VALUE 43, 0, ![[X]],
 ; CHECK: bb.2.if.end:
index 65ce447e23c80f1fc81036347e457d46c618376b..aa42eb385cc2ed5cd0bc99644b5d5e84fc0c3bd8 100644 (file)
@@ -14,8 +14,7 @@
 ; }
 
 ; CHECK: ![[ZZZ:.*]] = !DILocalVariable(name: "zzz",
-; CHECK: ![[ZZZ_EXPR:.*]] = !DIExpression(DW_OP_deref, DW_OP_constu, 400, DW_OP_minus)
-; CHECK: DBG_VALUE {{.*}} ![[ZZZ]], ![[ZZZ_EXPR]]
+; CHECK: DBG_VALUE {{.*}} ![[ZZZ]], !DIExpression(DW_OP_deref, DW_OP_constu, 400, DW_OP_minus)
 
 %struct.S = type { [100 x i32] }
 
index 1e68632f32e56dac3f972df69aef7c9d1a5f7bea..6e65c150b37582368b7cb9b383d8eec0385b8e7b 100644 (file)
 ;      return 0;
 ;    }
 ;
-; CHECK: ![[MDN1:[0-9]+]] = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
-; CHECK: ![[MDN2:[0-9]+]] = !DIExpression(DW_OP_LLVM_fragment, 32, 32)
-; CHECK-DAG: DBG_VALUE debug-use %{{[a-z]+}}, debug-use _, !{{[0-9]+}}, ![[MDN1]], debug-location !{{[0-9]+}}
-; CHECK-DAG: DBG_VALUE debug-use %{{[a-z]+}}, debug-use _, !{{[0-9]+}}, ![[MDN2]], debug-location !{{[0-9]+}}
+; CHECK-DAG: DBG_VALUE debug-use %{{[a-z]+}}, debug-use _, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 0, 32), debug-location !{{[0-9]+}}
+; CHECK-DAG: DBG_VALUE debug-use %{{[a-z]+}}, debug-use _, !{{[0-9]+}}, !DIExpression(DW_OP_LLVM_fragment, 32, 32), debug-location !{{[0-9]+}}
 
 ; ModuleID = 'sdagsplit-1.c'
 target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
index ffe043423b10ff9de116b142a478cc1183315c2f..bd431a1eb286b0a824ed0d0a3e294b38044ee4ad 100644 (file)
 
 ; Verify that SROA creates a variable piece when splitting i1.
 ; CHECK: %[[I1:.*]] = alloca [12 x i8], align 4
-; CHECK: call void @llvm.dbg.declare(metadata [12 x i8]* %[[I1]], metadata ![[VAR:[0-9]+]], metadata ![[PIECE1:[0-9]+]])
-; CHECK: call void @llvm.dbg.value(metadata i32 %[[A:.*]], metadata ![[VAR]], metadata ![[PIECE2:[0-9]+]])
+; CHECK: call void @llvm.dbg.declare(metadata [12 x i8]* %[[I1]], metadata ![[VAR:[0-9]+]], metadata !DIExpression(DW_OP_LLVM_fragment, 32, 96))
+; CHECK: call void @llvm.dbg.value(metadata i32 %[[A:.*]], metadata ![[VAR]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32))
 ; CHECK: ret i32 %[[A]]
 ; Read Var and Piece:
 ; CHECK: ![[VAR]] = !DILocalVariable(name: "i1",{{.*}} line: 11,
-; CHECK: ![[PIECE1]] = !DIExpression(DW_OP_LLVM_fragment, 32, 96)
-; CHECK: ![[PIECE2]] = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
 
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-apple-macosx10.9.0"
index be93a33c07e3800e2c84405fa02803aadee19dd4..b2bec7cede0e3af2f951da80fe4b5a82ec3fa79b 100644 (file)
 ;
 
 ; Verify that SROA creates a variable piece when splitting i1.
-; CHECK:  call void @llvm.dbg.value(metadata i64 %outer.coerce0, metadata ![[O:[0-9]+]], metadata ![[PIECE1:[0-9]+]]),
-; CHECK:  call void @llvm.dbg.value(metadata i64 %outer.coerce1, metadata ![[O]], metadata ![[PIECE2:[0-9]+]]),
-; CHECK:  call void @llvm.dbg.value({{.*}}, metadata ![[I1:[0-9]+]], metadata ![[PIECE3:[0-9]+]]),
+; CHECK:  call void @llvm.dbg.value(metadata i64 %outer.coerce0, metadata ![[O:[0-9]+]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64)),
+; CHECK:  call void @llvm.dbg.value(metadata i64 %outer.coerce1, metadata ![[O]], metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64)),
+; CHECK:  call void @llvm.dbg.value({{.*}}, metadata ![[I1:[0-9]+]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)),
 ; CHECK-DAG: ![[O]] = !DILocalVariable(name: "outer",{{.*}} line: 10
-; CHECK-DAG: ![[PIECE1]] = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
-; CHECK-DAG: ![[PIECE2]] = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
 ; CHECK-DAG: ![[I1]] = !DILocalVariable(name: "i1",{{.*}} line: 11
-; CHECK-DAG: ![[PIECE3]] = !DIExpression(DW_OP_LLVM_fragment, 0, 32)
 
 ; ModuleID = 'sroasplit-2.c'
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
index 5617526fe93e314b0e364e57a17098e264d7f26a..e11e31c1841a782f13a639c24f4b6d792f74209b 100644 (file)
@@ -3,10 +3,8 @@
 ; Test that SROA updates the debug info correctly if an alloca was rewritten but
 ; not partitioned into multiple allocas.
 ;
-; CHECK: call void @llvm.dbg.value(metadata float %s.coerce, metadata ![[VAR:[0-9]+]], metadata ![[EXPR:[0-9]+]])
+; CHECK: call void @llvm.dbg.value(metadata float %s.coerce, metadata ![[VAR:[0-9]+]], metadata !DIExpression())
 ; CHECK: ![[VAR]] = !DILocalVariable(name: "s",{{.*}} line: 3,
-; CHECK: ![[EXPR]] = !DIExpression(
-; CHECK-NOT:                       DW_OP_LLVM_fragment
 
 ;
 ; struct S { float f; };
index 5ae65038147ea2005e5e954f4a68cc6fccde1847..718dc9beb2d1f7f1d1c85fabe9ff976e2ec7d5bc 100644 (file)
@@ -2,15 +2,11 @@
 ;
 ; Test that recursively splitting an alloca updates the debug info correctly.
 ; CHECK: %[[T:.*]] = load i64, i64* @t, align 8
-; CHECK: call void @llvm.dbg.value(metadata i64 %[[T]], metadata ![[Y:.*]], metadata ![[P1:.*]])
+; CHECK: call void @llvm.dbg.value(metadata i64 %[[T]], metadata ![[Y:.*]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64))
 ; CHECK: %[[T1:.*]] = load i64, i64* @t, align 8
-; CHECK: call void @llvm.dbg.value(metadata i64 %[[T1]], metadata ![[Y]], metadata ![[P2:.*]])
-; CHECK: call void @llvm.dbg.value(metadata i64 %[[T]], metadata ![[R:.*]], metadata ![[P3:.*]])
-; CHECK: call void @llvm.dbg.value(metadata i64 %[[T1]], metadata ![[R]], metadata ![[P4:.*]])
-; CHECK: ![[P1]] = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
-; CHECK: ![[P2]] = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
-; CHECK: ![[P3]] = !DIExpression(DW_OP_LLVM_fragment, 192, 64)
-; CHECK: ![[P4]] = !DIExpression(DW_OP_LLVM_fragment, 256, 64)
+; CHECK: call void @llvm.dbg.value(metadata i64 %[[T1]], metadata ![[Y]], metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64))
+; CHECK: call void @llvm.dbg.value(metadata i64 %[[T]], metadata ![[R:.*]], metadata !DIExpression(DW_OP_LLVM_fragment, 192, 64))
+; CHECK: call void @llvm.dbg.value(metadata i64 %[[T1]], metadata ![[R]], metadata !DIExpression(DW_OP_LLVM_fragment, 256, 64))
 ; 
 ; struct p {
 ;   __SIZE_TYPE__ s;
index 0366c0008d34dbbf54ff470be1fb311b9ab1d4bd..37829b0053fb84e60dcadb1bff252408994a5306 100644 (file)
@@ -24,9 +24,9 @@ entry:
 ;   CHECK: entry:
 ; Verify that llvm.dbg.declare calls are in the entry basic block.
 ;   CHECK-NOT: %entry
-;   CHECK: call void @llvm.dbg.declare(metadata {{.*}}, metadata ![[ARG_ID:[0-9]+]], metadata ![[EMPTY:[0-9]+]])
+;   CHECK: call void @llvm.dbg.declare(metadata {{.*}}, metadata ![[ARG_ID:[0-9]+]], metadata !DIExpression())
 ;   CHECK-NOT: %entry
-;   CHECK: call void @llvm.dbg.declare(metadata {{.*}}, metadata ![[VAR_ID:[0-9]+]], metadata ![[EMPTY:[0-9]+]])
+;   CHECK: call void @llvm.dbg.declare(metadata {{.*}}, metadata ![[VAR_ID:[0-9]+]], metadata !DIExpression())
 
 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
 
@@ -47,7 +47,6 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
 ; Verify that debug descriptors for argument and local variable will be replaced
 ; with descriptors that end with OpDeref (encoded as 2).
 ;   CHECK: ![[ARG_ID]] = !DILocalVariable(name: "p", arg: 1,{{.*}} line: 1
-;   CHECK: ![[EMPTY]] = !DIExpression()
 ;   CHECK: ![[VAR_ID]] = !DILocalVariable(name: "r",{{.*}} line: 2
 ; Verify that there are no more variable descriptors.
 ;   CHECK-NOT: !DILocalVariable(tag: DW_TAG_arg_variable
index 1f324f38c125fbf80058e9b565cb8edbc7657c4e..06c3d8ee4708e15881329ea009815947f8b12f9c 100644 (file)
@@ -15,9 +15,8 @@ define void @use1() {
 }
 ; CHECK: [[A]] = !DIGlobalVariableExpression(var: [[AVAR:![0-9]+]])
 ; CHECK: [[AVAR]] = !DIGlobalVariable(name: "a", scope: null, type: !2, isLocal: false, isDefinition: true)
-; CHECK: [[B]] = !DIGlobalVariableExpression(var: [[BVAR:![0-9]+]], expr: [[EXPR:![0-9]+]])
+; CHECK: [[B]] = !DIGlobalVariableExpression(var: [[BVAR:![0-9]+]], expr: !DIExpression(DW_OP_plus_uconst, 4))
 ; CHECK: [[BVAR]] = !DIGlobalVariable(name: "b", scope: null, type: !2, isLocal: false, isDefinition: true)
-; CHECK: [[EXPR]] = !DIExpression(DW_OP_plus_uconst, 4)
 
 !llvm.module.flags = !{!4, !5}
 
index e2d8551a90831abe3849bed18574569331de731c..918b9b6f679ff7af9535cfea3a8bdace0673a878 100644 (file)
@@ -43,7 +43,7 @@ define void @bar(float* %dst) #0 !dbg !9 {
 entry:
 
 ; CHECK: [[x_addr_i:%[a-zA-Z0-9.]+]] = alloca float, align 4
-; CHECK-NEXT: void @llvm.dbg.declare(metadata float* [[x_addr_i]], metadata [[m23:![0-9]+]], metadata !{{[0-9]+}}), !dbg [[m24:![0-9]+]]
+; CHECK-NEXT: void @llvm.dbg.declare(metadata float* [[x_addr_i]], metadata [[m23:![0-9]+]], metadata !DIExpression()), !dbg [[m24:![0-9]+]]
 
   %dst.addr = alloca float*, align 4
   store float* %dst, float** %dst.addr, align 4
index 41f052718387daec8fc065cf17d7929a7a169319..efc68abf6aa506d5d529ff58217d52425fd4d734 100644 (file)
@@ -32,7 +32,7 @@ entry:
 ; CHECK: define void @salvage_load
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.entry** %queue,
-; CHECK-SAME:                           metadata ![[LOAD_EXPR:[0-9]+]])
+; CHECK-SAME:                           metadata !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 0))
   store %struct.entry* %1, %struct.entry** %im_not_dead, align 8
   ret void, !dbg !21
 }
@@ -46,7 +46,7 @@ entry:
 ; CHECK: define void @salvage_bitcast
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.entry* %queue,
-; CHECK-SAME:                           metadata ![[BITCAST_EXPR:[0-9]+]])
+; CHECK-SAME:                           metadata !DIExpression(DW_OP_plus_uconst, 0))
   store i8* %1, i8** %im_not_dead, align 8
   ret void, !dbg !23
 }
@@ -60,7 +60,7 @@ entry:
 ; CHECK: define void @salvage_gep0
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.entry* %queue,
-; CHECK-SAME:                           metadata ![[GEP0_EXPR:[0-9]+]])
+; CHECK-SAME:                           metadata !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_plus_uconst, 0, DW_OP_stack_value))
   store %struct.entry** %1, %struct.entry*** %im_not_dead, align 8
   ret void, !dbg !26
 }
@@ -74,7 +74,7 @@ entry:
 ; CHECK: define void @salvage_gep1
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.entry* %queue,
-; CHECK-SAME:                           metadata ![[GEP1_EXPR:[0-9]+]])
+; CHECK-SAME:     metadata !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32))
   store %struct.entry** %1, %struct.entry*** %im_not_dead, align 8
   ret void, !dbg !29
 }
@@ -88,18 +88,11 @@ entry:
 ; CHECK: define void @salvage_gep2
 ; CHECK-NEXT: entry:
 ; CHECK-NEXT: call void @llvm.dbg.value(metadata %struct.entry* %queue,
-; CHECK-SAME:                           metadata ![[GEP2_EXPR:[0-9]+]])
+; CHECK-SAME:     metadata !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value))
   store %struct.entry** %1, %struct.entry*** %im_not_dead, align 8
   ret void, !dbg !32
 }
 
-; CHECK: ![[LOAD_EXPR]] = !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 0)
-; CHECK: ![[BITCAST_EXPR]] = !DIExpression(DW_OP_plus_uconst, 0)
-; CHECK: ![[GEP0_EXPR]] = !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_plus_uconst, 0, DW_OP_stack_value)
-; CHECK: ![[GEP1_EXPR]] = !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value,
-; CHECK-SAME:                           DW_OP_LLVM_fragment, 0, 32)
-; CHECK: ![[GEP2_EXPR]] = !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value)
-
 ; Function Attrs: nounwind readnone
 declare void @llvm.dbg.value(metadata, metadata, metadata) #1
 
index 6aa2fdb9f2b674de32fcc563dcf7bd8272523837..6254c55e8f314e8e715adcda0692463b6304d598 100644 (file)
@@ -3,10 +3,12 @@
 ;CHECK-LABEL: func
 ;CHECK-LABEL: entry
 ;CHECK-NEXT: tail call void @llvm.dbg.value(metadata i32 %a
-;CHECK-NEXT: tail call void @llvm.dbg.value(metadata i32 1, metadata !13, metadata !11), !dbg !15
+;CHECK-NEXT: tail call void @llvm.dbg.value(metadata i32 1, metadata ![[I_VAR:[0-9]+]], metadata !DIExpression())
 ;CHECK-LABEL: for.body:
 ;CHECK-NEXT: [[I:%.*]] = phi i32 [ 1, %entry ], [ %inc, %for.body ]
-;CHECK-NEXT: tail call void @llvm.dbg.value(metadata i32 [[I]], metadata !13, metadata !11), !dbg !15
+;CHECK-NEXT: tail call void @llvm.dbg.value(metadata i32 [[I]], metadata ![[I_VAR]], metadata !DIExpression())
+
+; CHECK: ![[I_VAR]] = !DILocalVariable(name: "i",{{.*}})
 
 ; Function Attrs: noinline nounwind
 define void @func(i32 %a) local_unnamed_addr #0 !dbg !6 {
index 787b24633649e413f950ce688d6866d691b6f9fa..7b47c70e1e6ab356e2b63d2daa77e0e3c390b40f 100644 (file)
@@ -14,17 +14,15 @@ for.cond:
 ; CHECK: %[[PHI:.*]] = phi i8 [ 0, %entry ], [ %0, %for.cond ]
   %entryN = load i8, i8* %entry1, align 8, !dbg !20
 ; CHECK: call void @llvm.dbg.value(metadata i8 %[[PHI]],
-; CHECK-SAME:                      metadata ![[EXPR:[0-9]+]])
+; CHECK-SAME:                      metadata !DIExpression())
   %0 = add i8 %entryN, 1
 ; CHECK: %0 = add i8 %[[PHI]], 1
 ; CHECK: call void @llvm.dbg.value(metadata i8 %0,
-; CHECK-SAME:                      metadata ![[EXPR]])
+; CHECK-SAME:                      metadata !DIExpression())
   store i8 %0, i8* %entry1, align 8, !dbg !20
   br label %for.cond, !dbg !20
 }
 
-; CHECK: ![[EXPR]] = !DIExpression()
-
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 
 attributes #0 = { nounwind ssp uwtable }
index 57d5aef6d65d52c1fee781f22cea1578ad7b7698..d24c7a7c48d0426745de5583a848a979a3d0a5f0 100644 (file)
@@ -87,17 +87,17 @@ define i32 @maxB(i32 %x, i32 %y) !dbg !34 {
 ; OPTIMIZATION_LEVEL_0-NEXT: %x.addr = alloca i32, align 4
 ; OPTIMIZATION_LEVEL_0-NEXT: %y.addr = alloca i32, align 4
 ; OPTIMIZATION_LEVEL_0-NEXT: store i32 %x, i32* %x.addr, align 4
-; OPTIMIZATION_LEVEL_0-NEXT: call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !{{[0-9]+}}, metadata !{{[0-9]+}}), !dbg !{{[0-9]+}}
+; OPTIMIZATION_LEVEL_0-NEXT: call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !{{[0-9]+}}, metadata !DIExpression()), !dbg !{{[0-9]+}}
 ; OPTIMIZATION_LEVEL_0-NEXT: store i32 %y, i32* %y.addr, align 4
-; OPTIMIZATION_LEVEL_0-NEXT: call void @llvm.dbg.declare(metadata i32* %y.addr, metadata !{{[0-9]+}}, metadata !{{[0-9]+}}), !dbg !{{[0-9]+}}
+; OPTIMIZATION_LEVEL_0-NEXT: call void @llvm.dbg.declare(metadata i32* %y.addr, metadata !{{[0-9]+}}, metadata !DIExpression()), !dbg !{{[0-9]+}}
 ; OPTIMIZATION_LEVEL_0-NEXT: %0 = tail call i32 @maxA(i32 %x, i32 %y), !dbg !{{[0-9]+}}
 ; OPTIMIZATION_LEVEL_0-NEXT: ret i32 %0, !dbg !{{[0-9]+}}
 ; OPTIMIZATION_LEVEL_0-NEXT: }
 
 ; OPTIMIZATION_LEVEL_2: define i32 @maxB(i32 %x, i32 %y)
 ; OPTIMIZATION_LEVEL_2-NEXT: entry:
-; OPTIMIZATION_LEVEL_2-NEXT: tail call void @llvm.dbg.value(metadata i32 %x, metadata !{{[0-9]+}}, metadata !{{[0-9]+}}), !dbg !{{[0-9]+}}
-; OPTIMIZATION_LEVEL_2-NEXT: tail call void @llvm.dbg.value(metadata i32 %y, metadata !{{[0-9]+}}, metadata !{{[0-9]+}}), !dbg !{{[0-9]+}}
+; OPTIMIZATION_LEVEL_2-NEXT: tail call void @llvm.dbg.value(metadata i32 %x, metadata !{{[0-9]+}}, metadata !DIExpression()), !dbg !{{[0-9]+}}
+; OPTIMIZATION_LEVEL_2-NEXT: tail call void @llvm.dbg.value(metadata i32 %y, metadata !{{[0-9]+}}, metadata !DIExpression()), !dbg !{{[0-9]+}}
 ; OPTIMIZATION_LEVEL_2-NEXT: %0 = tail call i32 @maxA(i32 %x, i32 %y) #{{[0-9]+}}, !dbg !{{[0-9]+}}
 ; OPTIMIZATION_LEVEL_2-NEXT: ret i32 %0, !dbg !{{[0-9]+}}
 ; OPTIMIZATION_LEVEL_2-NEXT: }
index d9a931f1d74d801ce7567024924c6f72abb37ad5..b174e5dc76458b14245f37eedc8d9913ad449eb4 100644 (file)
@@ -11,9 +11,8 @@ entry:
 ; Checks that SROA still inserts a bit_piece expression, even if it produces only one piece
 ; (as long as that piece is smaller than the whole thing)
 ; CHECK-NOT: call void @llvm.dbg.value
-; CHECK: call void @llvm.dbg.value(metadata %foo* undef, {{.*}}, metadata ![[BIT_PIECE:[0-9]+]]), !dbg
+; CHECK: call void @llvm.dbg.value(metadata %foo* undef, {{.*}}, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64)), !dbg
 ; CHECK-NOT: call void @llvm.dbg.value
-; CHECK: ![[BIT_PIECE]] = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
   %0 = bitcast %foo* %retval to i8*
   %1 = getelementptr inbounds i8, i8* %0, i64 8
   %2 = bitcast i8* %1 to %foo**
index aedd9612e941662624fe18d5bfe7a66213930f3a..b96f6abc59f778cd68518a6c6bcb89e379922e3c 100644 (file)
@@ -14,7 +14,7 @@ entry:
   %0 = zext i32 %n to i64, !dbg !16
 
 ; CHECK:  store i8* %[[VLA:.*]], i8** @__safestack_unsafe_stack_ptr
-; CHECK:  tail call void @llvm.dbg.value(metadata i8* %[[VLA]], metadata ![[TYPE:.*]], metadata ![[EXPR:.*]])
+; CHECK:  tail call void @llvm.dbg.value(metadata i8* %[[VLA]], metadata ![[TYPE:.*]], metadata !DIExpression(DW_OP_deref))
 ; CHECK:  call void @capture({{.*}} %[[VLA]])
 
   %vla = alloca i8, i64 %0, align 16, !dbg !16
@@ -50,7 +50,6 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
 !15 = !DILocation(line: 2, column: 12, scope: !6)
 !16 = !DILocation(line: 3, column: 3, scope: !6)
 
-; CHECK-DAG: ![[EXPR]] = !DIExpression(DW_OP_deref)
 !17 = !DIExpression(DW_OP_deref)
 !18 = !DILocation(line: 3, column: 8, scope: !6)
 !19 = !DILocation(line: 4, column: 3, scope: !6)
index d6b217142bfefc4db10bd0d0703308e240fc52c2..0a315d65e6bcab35c1f676db9195c82e4c5be604 100644 (file)
@@ -20,9 +20,9 @@ entry:
 
 ; dbg.declare for %zzz and %xxx are gone; replaced with dbg.declare based off the unsafe stack pointer
 ; CHECK-NOT: call void @llvm.dbg.declare
-; CHECK: call void @llvm.dbg.declare(metadata i8* %[[USP]], metadata ![[VAR_ARG:.*]], metadata ![[EXPR_ARG:.*]])
+; CHECK: call void @llvm.dbg.declare(metadata i8* %[[USP]], metadata ![[VAR_ARG:.*]], metadata !DIExpression(DW_OP_constu, 104, DW_OP_minus))
 ; CHECK-NOT: call void @llvm.dbg.declare
-; CHECK: call void @llvm.dbg.declare(metadata i8* %[[USP]], metadata ![[VAR_LOCAL:.*]], metadata ![[EXPR_LOCAL:.*]])
+; CHECK: call void @llvm.dbg.declare(metadata i8* %[[USP]], metadata ![[VAR_LOCAL:.*]], metadata !DIExpression(DW_OP_constu, 208, DW_OP_minus))
 ; CHECK-NOT: call void @llvm.dbg.declare
 
   call void @Capture(%struct.S* %zzz), !dbg !23
@@ -37,10 +37,8 @@ entry:
 
 ; CHECK-DAG: ![[VAR_ARG]] = !DILocalVariable(name: "zzz"
 ; 100 aligned up to 8
-; CHECK-DAG: ![[EXPR_ARG]] = !DIExpression(DW_OP_constu, 104, DW_OP_minus
 
 ; CHECK-DAG: ![[VAR_LOCAL]] = !DILocalVariable(name: "xxx"
-; CHECK-DAG: ![[EXPR_LOCAL]] = !DIExpression(DW_OP_constu, 208, DW_OP_minus
 
 ; Function Attrs: nounwind readnone
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
index ac774650cad73b21e06ed08c481e54953386544b..20a9c37bc05ac1fdf34c1a65207d5e8031f248fb 100644 (file)
@@ -25,7 +25,7 @@ entry:
   tail call void @llvm.dbg.value(metadata i32* %x1, metadata !10, metadata !24), !dbg !16
 
 ; Supported dbg.value: rewritted based on the [[USP]] value.
-; CHECK: call void @llvm.dbg.value(metadata i8* %[[USP]], metadata ![[X1:.*]], metadata ![[X1_EXPR:.*]])
+; CHECK: call void @llvm.dbg.value(metadata i8* %[[USP]], metadata ![[X1:.*]], metadata !DIExpression(DW_OP_deref, DW_OP_constu, 4, DW_OP_minus))
   tail call void @llvm.dbg.value(metadata i32* %x1, metadata !10, metadata !15), !dbg !16
   call void @capture(i32* nonnull %x1), !dbg !17
 
@@ -33,7 +33,7 @@ entry:
 ; CHECK: call void @llvm.random.metadata.use(metadata ![[EMPTY]])
   call void @llvm.random.metadata.use(metadata i32* %x2)
 
-; CHECK: call void @llvm.dbg.value(metadata i8* %[[USP]], metadata ![[X2:.*]], metadata ![[X2_EXPR:.*]])
+; CHECK: call void @llvm.dbg.value(metadata i8* %[[USP]], metadata ![[X2:.*]], metadata !DIExpression(DW_OP_deref, DW_OP_constu, 8, DW_OP_minus))
   call void @llvm.dbg.value(metadata i32* %x2, metadata !12, metadata !15), !dbg !18
   call void @capture(i32* nonnull %x2), !dbg !19
   ret void, !dbg !20
@@ -84,8 +84,6 @@ attributes #4 = { nounwind }
 !13 = !DILocation(line: 5, column: 3, scope: !6)
 !14 = !DILocation(line: 6, column: 3, scope: !6)
 
-; CHECK-DAG: ![[X1_EXPR]] = !DIExpression(DW_OP_deref, DW_OP_constu, 4, DW_OP_minus)
-; CHECK-DAG: ![[X2_EXPR]] = !DIExpression(DW_OP_deref, DW_OP_constu, 8, DW_OP_minus)
 !15 = !DIExpression(DW_OP_deref)
 !16 = !DILocation(line: 5, column: 7, scope: !6)
 !17 = !DILocation(line: 8, column: 3, scope: !6)
index 173d52ce0a734df7ee55e970f91fb0182b6beb5d..71d5e070f5da953c2015053a9adcdf5f3402ba4f 100644 (file)
 ; parameter. It can reference the register it's in directly without masking off
 ; high bits or anything
 
-; CHECK: call void @llvm.dbg.value(metadata i8 %g.coerce0, metadata ![[VAR_STRUCT:[0-9]+]], metadata ![[EXPR_STRUCT1:[0-9]+]])
-; CHECK: call void @llvm.dbg.value(metadata i64 %g.coerce1, metadata ![[VAR_STRUCT]], metadata ![[EXPR_STRUCT2:[0-9]+]])
-; CHECK: call void @llvm.dbg.value(metadata i1 %b, metadata ![[VAR_BOOL:[0-9]+]], metadata ![[EXPR_BOOL:[0-9]+]])
-; CHECK: call void @llvm.dbg.value(metadata i1 %frag, metadata ![[FRAG_BOOL:[0-9]+]], metadata ![[FRAG_BOOL:[0-9]+]])
-; CHECK: ![[EXPR_STRUCT1]] = !DIExpression(DW_OP_LLVM_fragment, 0, 8)
-; CHECK: ![[EXPR_STRUCT2]] = !DIExpression(DW_OP_LLVM_fragment, 32, 64)
-; CHECK: ![[EXPR_BOOL]] = !DIExpression()
-; CHECK: ![[FRAG_BOOL]] = !DIExpression(DW_OP_LLVM_fragment, 0, 1)
+; CHECK: call void @llvm.dbg.value(metadata i8 %g.coerce0, metadata ![[VAR_STRUCT:[0-9]+]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 8))
+; CHECK: call void @llvm.dbg.value(metadata i64 %g.coerce1, metadata ![[VAR_STRUCT]], metadata !DIExpression(DW_OP_LLVM_fragment, 32, 64))
+; CHECK: call void @llvm.dbg.value(metadata i1 %b, metadata ![[VAR_BOOL:[0-9]+]], metadata !DIExpression())
+; CHECK: call void @llvm.dbg.value(metadata i1 %frag, metadata ![[VAR_FRAG:[0-9]+]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 1))
 
 %struct.foo = type { i8, i64 }