<div dir="ltr">Sounds like sort of "-gno-really-line-tables-only" (I kid, somewhat)<br><br>What's the end goal for this functionality? Does it make sense to plumb it through as another level alongside GMLT/limited/full?<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Apr 18, 2018 at 11:43 AM Alexey Bataev via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ABataev created this revision.<br>
ABataev added reviewers: tra, jlebar, echristo.<br>
Herald added subscribers: JDevlieghere, aprantl, jholewinski.<br>
<br>
For better support of the CUDA profiling tools with the optimized code<br>
we should be able to emit `.target` directive without `debug` option.<br>
This is required as `.line` and `.file` directives must be emitted, but<br>
the DWARF sections should be ignored. ptxas does not support compilation<br>
of the modules with the enabled debug info when optimization level is<br>
<br>
> 0, but allows to emit linenumbers for the profilers.<br>
<br>
`-no-cuda-debug` option disables emission of the `debug` option, but not<br>
the emission of the debug info itself.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D45782" rel="noreferrer" target="_blank">https://reviews.llvm.org/D45782</a><br>
<br>
Files:<br>
  lib/Target/NVPTX/NVPTXAsmPrinter.cpp<br>
  test/DebugInfo/NVPTX/debug-info.ll<br>
<br>
<br>
Index: test/DebugInfo/NVPTX/debug-info.ll<br>
===================================================================<br>
--- test/DebugInfo/NVPTX/debug-info.ll<br>
+++ test/DebugInfo/NVPTX/debug-info.ll<br>
@@ -1,4 +1,5 @@<br>
-; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s<br>
+; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda | FileCheck %s --check-prefixes=CHECK,DEBUG<br>
+; RUN: llc < %s -mtriple=nvptx64-nvidia-cuda -no-cuda-debug | FileCheck %s --check-prefixes=CHECK,NODEBUG<br>
<br>
 ; // Bitcode int this test case is reduced version of compiled code below:<br>
 ;__device__ inline void res(float x, float y, float *res) { *res = x + y; }<br>
@@ -9,7 +10,8 @@<br>
 ;    res(a * x[i], y[i], &y[i]);<br>
 ;}<br>
<br>
-; CHECK: .target sm_{{[0-9]+}}//, debug<br>
+; DEBUG: .target sm_{{[0-9]+}}//, debug<br>
+; NODEBUG: .target sm_{{[0-9]+$}}<br>
<br>
 ; CHECK: .visible .entry _Z5saxpyifPfS_(<br>
 ; CHECK: .param .u32 {{.+}},<br>
Index: lib/Target/NVPTX/NVPTXAsmPrinter.cpp<br>
===================================================================<br>
--- lib/Target/NVPTX/NVPTXAsmPrinter.cpp<br>
+++ lib/Target/NVPTX/NVPTXAsmPrinter.cpp<br>
@@ -93,6 +93,11 @@<br>
<br>
 #define DEPOTNAME "__local_depot"<br>
<br>
+static cl::opt<bool><br>
+    NoCudaDebug("no-cuda-debug",<br>
+                cl::desc("Do not mark ptx file as having debug info"),<br>
+                cl::init(false));<br>
+<br>
 /// DiscoverDependentGlobals - Return a set of GlobalVariables on which \p V<br>
 /// depends.<br>
 static void<br>
@@ -876,7 +881,7 @@<br>
     O << ", texmode_independent";<br>
<br>
   // FIXME: remove comment once debug info is properly supported.<br>
-  if (MMI && MMI->hasDebugInfo())<br>
+  if (MMI && MMI->hasDebugInfo() && !NoCudaDebug)<br>
     O << "//, debug";<br>
<br>
   O << "\n";<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>