[PATCH] D23749: [NVPTX] Add NVPTXHoistAddrSpaceCast pass.

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 21 00:05:37 PDT 2016


On Sat, Aug 20, 2016 at 9:01 PM, Justin Lebar <jlebar at google.com> wrote:

> Matt, I thought about making this pass generic, but as written it doesn't
> make much sense if you don't follow it with the equivalent of the NVPTX
> address space inference pass.
>
> David, I will meditate on this...
>

If you want, you could treat this as a data flow problem (treat
loads/stores/cmpxchgs/atomicrmws of your addrspacecast'd GEP as sources,
propagate that information across CFG edges, etc.).  Then you can know if a
block is dominated by blocks where the transform is known to be safe.


>
> On Aug 20, 2016 8:40 PM, "Matt Arsenault" <Matthew.Arsenault at amd.com>
> wrote:
>
>> arsenm added a subscriber: arsenm.
>>
>> ================
>> Comment at: llvm/lib/Target/NVPTX/NVPTXHoistAddrSpaceCast.cpp:156-160
>> @@ +155,7 @@
>> +    if (AddrSpaceCastInst *ASC = dyn_cast<AddrSpaceCastInst>(&I))
>> +      if (ASC->getSrcAddressSpace() == AddressSpace::ADDRESS_SPACE_GENERIC
>> &&
>> +          ASC->getDestAddressSpace() != AddressSpace::ADDRESS_SPACE_GENERIC
>> &&
>> +          ASC->getSrcTy()->getPointerElementType() ==
>> +              ASC->getDestTy()->getPointerElementType())
>> +        Worklist.push_back(ASC);
>> +
>> ----------------
>> Can you put this into a TTI hook?
>>
>>
>> https://reviews.llvm.org/D23749
>>
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160821/4b0277cf/attachment.html>


More information about the llvm-commits mailing list