[PATCH] [NVPTX] Replace addrspacecast with bitcast

Jingyue Wu jingyue at google.com
Tue Jun 3 11:37:49 PDT 2014


Hi Matt,

I found an issue with this patch that causes instcombine to run into an
infinite loops.

The test case is attached. The loop begins with the addrspacecast
instruction:

addrspacecast [16 x i32] addrspace(1)* %arr to i32

=> D2186

%0 = addrspacecast [16 x i32] addrspace(1)* %arr to [16 x i32]*
bitcast [16 x i32]* %0 to i32*

=> visitBitCast

%0 = addrspacecast [16 x i32] addrspace(1)* %arr to [16 x i32]*
getelementptr [16 x i32]* %0, i64 0, i64 0

=> visitGetElementPtr

%0 = getelementptr [16 x i32] addrspace(1)* %arr, i64 0, i64 0
addrspacecast i32 addrspace(1)* %0 to i32*

=> commonPointerCastTransforms

addrspacecast [16 x i32] addrspace(1)* %arr to i32

and we have a loop.

I'll try to figure out the root cause today.

Jingyue




On Thu, May 1, 2014 at 1:06 PM, Matt Arsenault <Matthew.Arsenault at amd.com>
wrote:

> I think so. I haven't looked at any of my addrspacecast patches in a
> while, but I do want to get those in.
>
> http://reviews.llvm.org/D3586
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140603/a339c3c4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: canonicalize-addrspacecast.ll
Type: application/octet-stream
Size: 212 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140603/a339c3c4/attachment.obj>


More information about the llvm-commits mailing list