regarding r221377

Jingyue Wu jingyue at google.com
Fri May 29 11:07:47 PDT 2015


Hi Justin,

I am looking at this patch you submitted last year. Sorry for bringing up
something cache-cold :)

Author: Justin Holewinski <jholewinski at nvidia.com>
Date:   Wed Nov 5 18:19:30 2014 +0000

    [NVPTX] Add NVPTXLowerStructArgs pass

    This works around the limitation that PTX does not allow .param space
    loads/stores with arbitrary pointers.

    If a function has a by-val struct ptr arg, say foo(%struct.x *byval
%d), then
    add the following instructions to the first basic block :

    %temp = alloca %struct.x, align 8
    %tt1 = bitcast %struct.x * %d to i8 *
    %tt2 = llvm.nvvm.cvt.gen.to.param %tt2
    %tempd = bitcast i8 addrspace(101) * to %struct.x addrspace(101) *
    %tv = load %struct.x addrspace(101) * %tempd
    store %struct.x %tv, %struct.x * %temp, align 8

    The above code allocates some space in the stack and copies the incoming
    struct from param space to local space. Then replace all occurences of
%d
    by %temp.

    Fixes PR21465.


Can you remind me why this pass is not enabled in NVPTX's backend pipeline,
e.g., NVPTXTargetPassConfig::addIRPass? We might have discussed this at
some point, but I forgot.

Thank you,
Jingyue
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150529/43448429/attachment.html>


More information about the llvm-commits mailing list