PATCH: fix clang to emit correct addrspacecast for CUDA

Jingyue Wu jingyue at google.com
Mon Mar 24 10:05:21 PDT 2014


Right. We are aware of this issue, and think it should be addressed in the
IR optimizer (similar to InstCombineLoadCast and InstCombineStoreToCast)
instead of clang. Do you think this is an appropriate approach? Is this
optimization general enough to stay in the IR optimizer or
target-dependent?

Jingyue


On Mon, Mar 24, 2014 at 4:54 AM, Justin Holewinski <
justin.holewinski at gmail.com> wrote:

> Hi Jingyue,
>
> I committed the addrspacecast isel patterns to NVPTX.  Also, I wanted to
> point out that your changes in the last test case in this patch (
> address-spaces.cu) represent changes that may lead to performance
> degradation.  Specific address spaces should be used whenever possible for
> loads/stores.  Casting everything to a generic address is still correct,
> but may lead to additional indirections for the hardware.
>
>
> On Fri, Mar 21, 2014 at 2:25 PM, Justin Holewinski <jholewinski at nvidia.com
> > wrote:
>
>>  addrspacecast support in NVPTX is on my todo list.  I'll try to put
>> something together in the next few days.
>>
>>
>> On 3/21/14, 2:20 PM, Jingyue Wu wrote:
>>
>> Hi,
>>
>>  Static local variables in CUDA can be declared with address space
>> qualifiers, such as __shared__. Therefore, the codegen needs to potentially
>> addrspacecast a static local variable to the type expected by its
>> declaration. Peter did something similar for global variables in r157167.
>>
>>  All clang tests passed.
>>
>>  Justin: The NVPTX backend support for addrspacecast seems not complete.
>> We can send you follow-up patches once this one gets in.
>>
>>  Jingyue
>>
>>
>>
>> --
>> Thanks,
>>
>> Justin Holewinski
>>
>>  ------------------------------
>>  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.
>>  ------------------------------
>>
>
>
>
> --
>
> Thanks,
>
> Justin Holewinski
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140324/f6f02b40/attachment.html>


More information about the cfe-commits mailing list