[PATCH] D17111: [CUDA] pass debug options to ptxas.

Hal Finkel via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 10 16:30:27 PST 2016


hfinkel added a subscriber: hfinkel.

================
Comment at: lib/Driver/Tools.cpp:10707
@@ +10706,3 @@
+    // ptxas does not accept -g option if optimization is enabled, so we ignore
+    // compiler's -O* options if we want debug info.
+    CmdArgs.push_back("-g");
----------------
echristo wrote:
> jlebar wrote:
> > I think this is would be very surprising to users.  -g does not usually have a large performance impact, so -O2 -g does not generally mean "generate slow code," as far as I know.  I'm concerned that this will result in people accidentally compiling with ptxas -O0 (which is why I didn't do it like this to begin with).
> > 
> > Can we accomplish this in a more explicit way?
> Other than warning I'm not sure what we can do, we could do that instead and make everyone use O0 that wants debug info in their ptx?
I'd rather we refuse to do anything (i.e. produce an error) than silently remove either optimizations or -g. Do we have a way to separately specify the optimization level for host and device code? If not, looks like we should add one.


http://reviews.llvm.org/D17111





More information about the cfe-commits mailing list