<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I’ve landed r370145 in an attempt to try and fix this. Please let me know if you see any further issues.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">vedant<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 27, 2019, at 6:05 PM, Vedant Kumar <<a href="mailto:vedant_kumar@apple.com" class="">vedant_kumar@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class="">Hi Galina,<div class=""><br class=""></div><div class="">I’m away from my computer at the moment but will take a look ASAP.<br class=""><br class=""><div dir="ltr" class="">vedant (sent from my iPhone)</div><div dir="ltr" class=""><br class="">On Aug 27, 2019, at 5:04 PM, Galina Kistanova <<a href="mailto:gkistanova@gmail.com" class="">gkistanova@gmail.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">Hello Vedant,<br class=""><br class="">This commit added broken test to the builder
llvm-clang-x86_64-expensive-checks-win

 .<br class=""><br class=""><a href="http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/19367/steps/test-check-all/logs/stdio" class="">http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/19367/steps/test-check-all/logs/stdio</a>:<br class="">. . . <br class="">Failing Tests (8):<br class="">    . . .<br class="">    LLVM :: DebugInfo/MIR/X86/DW_OP_entry_value.mir<br class="">    . . .<br class=""><br class="">The builder was already red and did not send notifications on this.<br class=""><div class="">For now it the only broken test on this builder.</div><div class=""> Please have a look?</div><br class="">Thanks<br class=""><br class="">Galina</div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 26, 2019 at 1:51 PM Vedant Kumar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: vedantk<br class="">
Date: Mon Aug 26 13:53:12 2019<br class="">
New Revision: 369966<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=369966&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=369966&view=rev</a><br class="">
Log:<br class="">
[DWARF] Pick the DWARF5 OP_entry_value opcode on Darwin<br class="">
<br class="">
Use the GNU extension for OP_entry_value consistently (i.e. whenever GNU<br class="">
extensions are used for TAG_call_site).<br class="">
<br class="">
Added:<br class="">
    llvm/trunk/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir<br class="">
Modified:<br class="">
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br class="">
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h<br class="">
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=369966&r1=369965&r2=369966&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=369966&r1=369965&r2=369966&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)<br class="">
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Mon Aug 26 13:53:12 2019<br class="">
@@ -892,9 +892,13 @@ void DwarfCompileUnit::constructAbstract<br class="">
     ContextCU->addDIEEntry(*AbsDef, dwarf::DW_AT_object_pointer, *ObjectPointer);<br class="">
 }<br class="">
<br class="">
+/// Whether to use the GNU analog for a DWARF5 tag, attribute, or location atom.<br class="">
+static bool useGNUAnalogForDwarf5Feature(DwarfDebug *DD) {<br class="">
+  return DD->getDwarfVersion() == 4 && DD->tuneForGDB();<br class="">
+}<br class="">
+<br class="">
 dwarf::Tag DwarfCompileUnit::getDwarf5OrGNUCallSiteTag(dwarf::Tag Tag) const {<br class="">
-  bool ApplyGNUExtensions = DD->getDwarfVersion() == 4 && DD->tuneForGDB();<br class="">
-  if (!ApplyGNUExtensions)<br class="">
+  if (!useGNUAnalogForDwarf5Feature(DD))<br class="">
     return Tag;<br class="">
   switch (Tag) {<br class="">
   case dwarf::DW_TAG_call_site:<br class="">
@@ -908,8 +912,7 @@ dwarf::Tag DwarfCompileUnit::getDwarf5Or<br class="">
<br class="">
 dwarf::Attribute<br class="">
 DwarfCompileUnit::getDwarf5OrGNUCallSiteAttr(dwarf::Attribute Attr) const {<br class="">
-  bool ApplyGNUExtensions = DD->getDwarfVersion() == 4 && DD->tuneForGDB();<br class="">
-  if (!ApplyGNUExtensions)<br class="">
+  if (!useGNUAnalogForDwarf5Feature(DD))<br class="">
     return Attr;<br class="">
   switch (Attr) {<br class="">
   case dwarf::DW_AT_call_all_calls:<br class="">
@@ -929,6 +932,18 @@ DwarfCompileUnit::getDwarf5OrGNUCallSite<br class="">
   }<br class="">
 }<br class="">
<br class="">
+dwarf::LocationAtom<br class="">
+DwarfCompileUnit::getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const {<br class="">
+  if (!useGNUAnalogForDwarf5Feature(DD))<br class="">
+    return Loc;<br class="">
+  switch (Loc) {<br class="">
+  case dwarf::DW_OP_entry_value:<br class="">
+    return dwarf::DW_OP_GNU_entry_value;<br class="">
+  default:<br class="">
+    llvm_unreachable("DWARF5 location atom with no GNU analog");<br class="">
+  }<br class="">
+}<br class="">
+<br class="">
 DIE &DwarfCompileUnit::constructCallSiteEntryDIE(<br class="">
     DIE &ScopeDIE, const DISubprogram *CalleeSP, bool IsTail,<br class="">
     const MCSymbol *PCAddr, const MCExpr *PCOffset, unsigned CallReg) {<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=369966&r1=369965&r2=369966&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=369966&r1=369965&r2=369966&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)<br class="">
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Mon Aug 26 13:53:12 2019<br class="">
@@ -234,6 +234,9 @@ public:<br class="">
   /// GNU attribute if needed.<br class="">
   dwarf::Attribute getDwarf5OrGNUCallSiteAttr(dwarf::Attribute Attr) const;<br class="">
<br class="">
+  /// This takes a DWARF 5 location atom and either returns it or a GNU analog.<br class="">
+  dwarf::LocationAtom getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const;<br class="">
+<br class="">
   /// Construct a call site entry DIE describing a call within \p Scope to a<br class="">
   /// callee described by \p CalleeSP.<br class="">
   /// \p IsTail specifies whether the call is a tail call.<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp?rev=369966&r1=369965&r2=369966&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp?rev=369966&r1=369965&r2=369966&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp (original)<br class="">
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfExpression.cpp Mon Aug 26 13:53:12 2019<br class="">
@@ -311,10 +311,7 @@ void DwarfExpression::addEntryValueExpre<br class="">
   assert(!isMemoryLocation() &&<br class="">
          "We don't support entry values of memory locations yet");<br class="">
<br class="">
-  if (DwarfVersion >= 5)<br class="">
-    emitOp(dwarf::DW_OP_entry_value);<br class="">
-  else<br class="">
-    emitOp(dwarf::DW_OP_GNU_entry_value);<br class="">
+  emitOp(CU.getDwarf5OrGNULocationAtom(dwarf::DW_OP_entry_value));<br class="">
   emitUnsigned(Op->getArg(0));<br class="">
 }<br class="">
<br class="">
<br class="">
Added: llvm/trunk/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir?rev=369966&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir?rev=369966&view=auto</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir (added)<br class="">
+++ llvm/trunk/test/DebugInfo/MIR/X86/DW_OP_entry_value.mir Mon Aug 26 13:53:12 2019<br class="">
@@ -0,0 +1,81 @@<br class="">
+# RUN: llc -debug-entry-values -mtriple=x86_64-apple-darwin -o %t %s -filetype=obj<br class="">
+# RUN: llvm-dwarfdump %t | FileCheck %s<br class="">
+#<br class="">
+# int global;<br class="">
+# int foo(int p, int q, int r) {<br class="">
+#   global = p + 1;<br class="">
+#   asm __volatile("" : : : "edi", "esi", "edx");<br class="">
+#   return 123;<br class="">
+# }<br class="">
+<br class="">
+# CHECK: DW_TAG_formal_parameter<br class="">
+# CHECK:   DW_OP_entry_value<br class="">
+<br class="">
+--- |<br class="">
+  ; ModuleID = 'multiple-param-dbg-value-entry.ll'<br class="">
+  source_filename = "multiple-param-dbg-value-entry.c"<br class="">
+  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"<br class="">
+<br class="">
+  @global = common dso_local local_unnamed_addr global i32 0, align 4, !dbg !0<br class="">
+<br class="">
+  define dso_local i32 @foo(i32 %p, i32 %q, i32 %r) local_unnamed_addr !dbg !11 {<br class="">
+  entry:<br class="">
+    call void @llvm.dbg.value(metadata i32 %p, metadata !15, metadata !DIExpression()), !dbg !18<br class="">
+    call void @llvm.dbg.value(metadata i32 %q, metadata !16, metadata !DIExpression()), !dbg !18<br class="">
+    call void @llvm.dbg.value(metadata i32 %r, metadata !17, metadata !DIExpression()), !dbg !18<br class="">
+    %add = add nsw i32 %p, 1, !dbg !18<br class="">
+    store i32 %add, i32* @global, align 4, !dbg !18<br class="">
+    tail call void asm sideeffect "", "~{edi},~{esi},~{edx},~{dirflag},~{fpsr},~{flags}"(), !dbg !18, !srcloc !19<br class="">
+    ret i32 123, !dbg !18<br class="">
+  }<br class="">
+<br class="">
+  ; Function Attrs: nounwind readnone speculatable<br class="">
+  declare void @llvm.dbg.value(metadata, metadata, metadata)<br class="">
+<br class="">
+  !<a href="http://llvm.dbg.cu/" rel="noreferrer" target="_blank" class="">llvm.dbg.cu</a> = !{!2}<br class="">
+  !llvm.module.flags = !{!7, !8, !9}<br class="">
+  !llvm.ident = !{!10}<br class="">
+<br class="">
+  !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())<br class="">
+  !1 = distinct !DIGlobalVariable(name: "global", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)<br class="">
+  !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 9.0.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)<br class="">
+  !3 = !DIFile(filename: "multiple-param-dbg-value-entry.c", directory: "/")<br class="">
+  !4 = !{}<br class="">
+  !5 = !{!0}<br class="">
+  !6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br class="">
+  !7 = !{i32 2, !"Dwarf Version", i32 4}<br class="">
+  !8 = !{i32 2, !"Debug Info Version", i32 3}<br class="">
+  !9 = !{i32 1, !"wchar_size", i32 4}<br class="">
+  !10 = !{!"clang version 9.0.0 "}<br class="">
+  !11 = distinct !DISubprogram(name: "foo", scope: !3, file: !3, line: 9, type: !12, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !2, retainedNodes: !14)<br class="">
+  !12 = !DISubroutineType(types: !13)<br class="">
+  !13 = !{!6, !6, !6, !6}<br class="">
+  !14 = !{!15, !16, !17}<br class="">
+  !15 = !DILocalVariable(name: "p", arg: 1, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified)<br class="">
+  !16 = !DILocalVariable(name: "q", arg: 2, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified)<br class="">
+  !17 = !DILocalVariable(name: "r", arg: 3, scope: !11, file: !3, line: 9, type: !6, flags: DIFlagArgumentNotModified)<br class="">
+  !18 = !DILocation(line: 9, column: 13, scope: !11)<br class="">
+  !19 = !{i32 213}<br class="">
+<br class="">
+...<br class="">
+---<br class="">
+name:            foo<br class="">
+alignment:       4<br class="">
+tracksRegLiveness: true<br class="">
+liveins:<br class="">
+  - { reg: '$edi' }<br class="">
+body:             |<br class="">
+  bb.0.entry:<br class="">
+    liveins: $edi<br class="">
+<br class="">
+    DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !18<br class="">
+    DBG_VALUE $edi, $noreg, !15, !DIExpression(), debug-location !18<br class="">
+    DBG_VALUE $esi, $noreg, !16, !DIExpression(), debug-location !18<br class="">
+    DBG_VALUE $edx, $noreg, !17, !DIExpression(), debug-location !18<br class="">
+    renamable $edi = nsw INC32r killed renamable $edi, implicit-def dead $eflags, debug-location !18<br class="">
+    MOV32mr $rip, 1, $noreg, @global, $noreg, killed renamable $edi, debug-location !18 :: (store 4 into @global)<br class="">
+    INLINEASM &"", 1, 12, implicit-def dead early-clobber $edi, 12, implicit-def dead early-clobber $esi, 12, implicit-def dead early-clobber $edx, 12, implicit-def dead early-clobber $df, 12, implicit-def dead early-clobber $fpsw, 12, implicit-def dead early-clobber $eflags, !19, debug-location !18<br class="">
+    $eax = MOV32ri 123, debug-location !18<br class="">
+    RETQ killed $eax, debug-location !18<br class="">
+<br class="">
+...<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div></div>
</div></blockquote></div></div></div></blockquote></div><br class=""></div></body></html>