regarding r221377
Justin Holewinski
jholewinski at nvidia.com
Tue Jun 2 07:31:44 PDT 2015
I can’t recall :(
Could just be an oversight; this pass is required for correctness.
On May 29, 2015, at 2:07 PM, Jingyue Wu <jingyue at google.com<mailto:jingyue at google.com>> wrote:
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<mailto: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
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150602/739ad89d/attachment.html>
More information about the llvm-commits
mailing list