[PATCH] Don't use runtime bounds check between different address space pointers

Matt Arsenault Matthew.Arsenault at amd.com
Wed Oct 2 11:54:32 PDT 2013


On 10/01/2013 08:30 PM, Nadav Rotem wrote:
> Hi Matt,
>
> Is this a real problem on R600 ?  The patch LGTM.   I did not understand the comment about the Parallel annotation.
>
> Thanks,
> Nadav

The bitcast is a problem. If the pointers were to be compared, they 
would need to use ptrtoint + compare. That still would not be valid when 
using the flat address space. For example a local pointer and a flat 
pointer to the same location wouldn't have the same bit value, and there 
is an instruction to map between them. The different address spaces are 
accessed with completely different instructions, so it doesn't make 
sense to cast between them ordinarily. Local and region pointers could 
have the same values, but be intended for different hardware. I'm pretty 
sure the current R600 target doesn't yet support either of these features.

I thought this check was happening later at the time and would allow 
inserting the runtime check, but I see now that it doesn't make sense.
>
> On Oct 1, 2013, at 7:14 PM, Matt Arsenault <Matthew.Arsenault at amd.com> wrote:
>
>> Hi nadav,
>>
>> Don't vectorize with a runtime check if it requires a comparison between pointers with different address spaces. The values can't be assumed to be directly comparable. Previously it would create an illegal bitcast.
>>
>> http://llvm-reviews.chandlerc.com/D1804
>>
>> Files:
>>   lib/Transforms/Vectorize/LoopVectorize.cpp
>>   test/Transforms/LoopVectorize/runtime-check-address-space.ll
>>   test/Transforms/LoopVectorize/runtime-check-readonly-address-space.ll
>> <D1804.1.patch>
>





More information about the llvm-commits mailing list