PR48153: ptxas, optimization flags, and debug info

We are having some troubles compiling to nvptx and at the
same time having debug information available, e.g., for remarks,
see https://bugs.llvm.org/show_bug.cgi?id=48153

From the looks of it, ptxas is unhappy if debug info is present at all
and an optimization flag other than O0 is given. If this is somewhat
accurate I'd propose to conditionally strip debug information late in
the pipeline for such configurations. The driver should be able to enable
this option if appropriate or we look at the target triple. I think we
have a pass that strips debug information, so we really would only need
to put it conditionally in the pipelines(s) and then enable it when
targeting nvptx.

This is just an idea and the underlying issue might be something different.

Please let us know what you think.

Thanks,
Johannes