[PATCH] Canonicalize addrspacecast between different pointer types.

Jingyue Wu jingyue at google.com
Tue Jun 3 11:42:29 PDT 2014


On Tue, Jun 3, 2014 at 11:41 AM, Jingyue Wu <jingyue at google.com> wrote:

> 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
>
> http://reviews.llvm.org/D2186
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140603/12bae2fb/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/12bae2fb/attachment.obj>


More information about the llvm-commits mailing list