<span lang="EN"><div>In the following example, for some reasons, the input pointer entering the loop was casted to generic pointer. How can the backend get rid of the</div><div>addrspacecast and use local store in the loop?</div>
<div> </div><div> </div><div><a href="http://for.body.lr.ph">for.body.lr.ph</a>:                                   ; preds = %entry</div>
<p>  %0 = addrspacecast i32 addrspace(3)* %in to i32 addrspace(4)*</p>
<p>  br label %for.body</p>

<p>for.body:                                         ; preds = %for.body, %<a href="http://for.body.lr.ph">for.body.lr.ph</a></p>
<p>  %i.03 = phi i32 [ 0, %<a href="http://for.body.lr.ph">for.body.lr.ph</a> ], [ %inc, %for.body ]</p>
<p>  %ptr.02 = phi i32 addrspace(4)* [ %0, %<a href="http://for.body.lr.ph">for.body.lr.ph</a> ], [ %add.ptr, %for.body ]</p>
<p>  store i32 %i.03, i32 addrspace(4)* %ptr.02, align 4</p>
<p>  %add.ptr = getelementptr inbounds i32 addrspace(4)* %ptr.02, i64 4</p>
<p>  %inc = add i32 %i.03, 1</p>
<p>  %exitcond = icmp eq i32 %inc, %numElems</p>
<p>  br i1 %exitcond, label %for.end, label %for.body</p>

<p>for.end:                                          ; preds = %</p></span><div><br><br>Thanks;</div><div> </div><div>Changpeng </div><div><br> </div>