Improving code generation in the nvptx back end

Bernd Schmidt bschmidt@redhat.com
Mon Feb 20 13:56:00 GMT 2017


On 02/17/2017 02:09 PM, Thomas Schwinge wrote:
> Hi!
>
> On Fri, 17 Feb 2017 14:00:09 +0100, I wrote:
>> [...] for "normal" functions there is no reason to use the
>> ".param" space for passing arguments in and out of functions.  We can
>> then get rid of the boilerplate code to move ".param %in_ar*" into ".reg
>> %ar*", and the other way round for "%value_out"/"%value".  This will then
>> also simplify the call sites, where all that code "evaporates".  That's
>> actually something I started to look into, many months ago, and I now
>> just dug out those changes, and will post them later.
>>
>> (Very likely, the PTX "JIT" compiler will do the very same thing without
>> difficulty, but why not directly generate code that is less verbose to
>> read?)
>
> Using my WIP patch, the generated PTX code changes/is simplified as
> follows:

It's probably a good idea to run cuobjdump -sass to see whether this has 
any effect at all.

The most important issue that needs solving is probably still the old 
issue that ptxas isn't reliable. Looks like the llvm folks ran into the 
same problem, as I discovered last week:
   https://bugs.llvm.org//show_bug.cgi?id=27738


Bernd



More information about the Gcc mailing list