<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">I can’t recall :(</div>
<div class=""><br class="">
</div>
<div class="">Could just be an oversight; this pass is required for correctness.</div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On May 29, 2015, at 2:07 PM, Jingyue Wu <<a href="mailto:jingyue@google.com" class="">jingyue@google.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hi Justin, 
<div class=""><br class="">
</div>
<div class="">I am looking at this patch you submitted last year. Sorry for bringing up something cache-cold :)</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">Author: Justin Holewinski <<a href="mailto:jholewinski@nvidia.com" class="">jholewinski@nvidia.com</a>></div>
<div class="">Date:   Wed Nov 5 18:19:30 2014 +0000</div>
<div class=""><br class="">
</div>
<div class="">    [NVPTX] Add NVPTXLowerStructArgs pass</div>
<div class="">    </div>
<div class="">    This works around the limitation that PTX does not allow .param space</div>
<div class="">    loads/stores with arbitrary pointers.</div>
<div class="">    </div>
<div class="">    If a function has a by-val struct ptr arg, say foo(%struct.x *byval %d), then</div>
<div class="">    add the following instructions to the first basic block :</div>
<div class="">    </div>
<div class="">    %temp = alloca %struct.x, align 8</div>
<div class="">    %tt1 = bitcast %struct.x * %d to i8 *</div>
<div class="">    %tt2 = llvm.nvvm.cvt.gen.to.param %tt2</div>
<div class="">    %tempd = bitcast i8 addrspace(101) * to %struct.x addrspace(101) *</div>
<div class="">    %tv = load %struct.x addrspace(101) * %tempd</div>
<div class="">    store %struct.x %tv, %struct.x * %temp, align 8</div>
<div class="">    </div>
<div class="">    The above code allocates some space in the stack and copies the incoming</div>
<div class="">    struct from param space to local space. Then replace all occurences of %d</div>
<div class="">    by %temp.</div>
<div class="">    </div>
<div class="">    Fixes PR21465.</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">Thank you, </div>
<div class="">Jingyue</div>
</div>
</div>
</blockquote>
</div>
<br class="">

<DIV>
<HR>
</DIV>
<DIV>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. </DIV>
<DIV>
<HR>
</DIV>
</body>
</html>