<div dir="ltr"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 3, 2014 at 11:41 AM, Jingyue Wu <span dir="ltr"><<a href="mailto:jingyue@google.com" target="_blank">jingyue@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Matt,<br>
<br>
I found an issue with this patch that causes instcombine to run into an<br>
infinite loops.<br>
<br>
The test case is attached. The loop begins with the addrspacecast<br>
instruction:<br>
<br>
addrspacecast [16 x i32] addrspace(1)* %arr to i32<br>
<br>
--> D2186:<br>
<br>
%0 = addrspacecast [16 x i32] addrspace(1)* %arr to [16 x i32]*<br>
bitcast [16 x i32]* %0 to i32*<br>
<br>
--> visitBitCast<br>
<br>
%0 = addrspacecast [16 x i32] addrspace(1)* %arr to [16 x i32]*<br>
getelementptr [16 x i32]* %0, i64 0, i64 0<br>
<br>
--> visitGetElementPtr<br>
<br>
%0 = getelementptr [16 x i32] addrspace(1)* %arr, i64 0, i64 0<br>
addrspacecast i32 addrspace(1)* %0 to i32*<br>
<br>
--> commonPointerCastTransforms<br>
<br>
addrspacecast [16 x i32] addrspace(1)* %arr to i32<br>
<br>
and we have a loop.<br>
<br>
I'll try to figure out the root cause today.<br>
<br>
Jingyue<br>
<br>
<a href="http://reviews.llvm.org/D2186" target="_blank">http://reviews.llvm.org/D2186</a><br>
<br>
<br>
</blockquote></div><br></div>