<div dir="ltr">Hi Justin, <div><br></div><div>I am looking at this patch you submitted last year. Sorry for bringing up something cache-cold :)</div><div><br></div><div><div>Author: Justin Holewinski <<a href="mailto:jholewinski@nvidia.com">jholewinski@nvidia.com</a>></div><div>Date:   Wed Nov 5 18:19:30 2014 +0000</div><div><br></div><div>    [NVPTX] Add NVPTXLowerStructArgs pass</div><div>    </div><div>    This works around the limitation that PTX does not allow .param space</div><div>    loads/stores with arbitrary pointers.</div><div>    </div><div>    If a function has a by-val struct ptr arg, say foo(%struct.x *byval %d), then</div><div>    add the following instructions to the first basic block :</div><div>    </div><div>    %temp = alloca %struct.x, align 8</div><div>    %tt1 = bitcast %struct.x * %d to i8 *</div><div>    %tt2 = llvm.nvvm.cvt.gen.to.param %tt2</div><div>    %tempd = bitcast i8 addrspace(101) * to %struct.x addrspace(101) *</div><div>    %tv = load %struct.x addrspace(101) * %tempd</div><div>    store %struct.x %tv, %struct.x * %temp, align 8</div><div>    </div><div>    The above code allocates some space in the stack and copies the incoming</div><div>    struct from param space to local space. Then replace all occurences of %d</div><div>    by %temp.</div><div>    </div><div>    Fixes PR21465.</div></div><div><br></div><div><br></div><div>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. </div><div><br></div><div>Thank you, </div><div>Jingyue</div></div>