<div dir="ltr"><div>Hi all,</div><div><br></div><div>Firstly, thanks.</div><div><br></div><div>> What are you actually trying to achieve? </div><div><br></div><div>Please, take a look in the basic block below:</div><div><br></div><div>for.body: ; preds = %for.cond </div><div>%idxprom = sext i32 %i.0 to i64, !dbg !32 </div><div>%0 = load i32*, i32** @vectorE, align 8, !dbg !32 </div><div>%arrayidx = getelementptr inbounds i32, i32* %0, i64 %idxprom, !dbg !32 </div><div>store i32 %i.0, i32* %arrayidx, align 4, !dbg !33 </div><div>br label %for.inc, !dbg !32</div><div><br></div><div>I need to try remove this load of the loop. If I do this, all loads</div><div>of this code can’t generate alias.</div><div>running the second code, all loads haven’t alias, like you can see below:</div><div><br></div><div>for.body: ; preds = %for.cond </div><div>%idxprom = sext i32 %i.0 to i64, !dbg !35 </div><div>%arrayidx = getelementptr inbounds i32, i32* %0, i64 %idxprom, !dbg !35 </div><div>store i32 %i.0, i32* %arrayidx, align 4, !dbg !36 </div><div>br label %for.inc, !dbg !35 </div><div><br></div><div>I need to reduce the number of alias in the code.</div><div><br></div><div>I’ve tried to use this flags:</div><div><br></div><div>-mem2reg</div><div>-basicaa</div><div>-globalsmodref-aa</div><div>-tbaa </div><div>-scev-aa</div><div>-adce</div><div>-licm</div><div>-argpromotion</div><div>-gvn</div><div>-memcpyopt</div><div>-dse</div><div>-print-alias-sets</div><div>-count-aa</div><div>-aa-eval</div><div><br></div><div>Regards,</div><div><br></div><div> Gleison</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-02 17:10 GMT-02:00 Gleison Souza <span dir="ltr"><<a href="mailto:gleison14051994@gmail.com" target="_blank">gleison14051994@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>Firstly, thanks.</div><span class=""><div><br></div><div>> What are you actually trying to achieve? </div><div><br></div></span><div>Please, take a look in the basic block below:</div><div><br></div><div>for.body: ; preds = %for.cond </div><div>%idxprom = sext i32 %i.0 to i64, !dbg !32 </div><div>%0 = load i32*, i32** @vectorE, align 8, !dbg !32 </div><div>%arrayidx = getelementptr inbounds i32, i32* %0, i64 %idxprom, !dbg !32 </div><div>store i32 %i.0, i32* %arrayidx, align 4, !dbg !33 </div><div>br label %for.inc, !dbg !32</div><div><br></div><div>I need to try remove this load of the loop. If I do this, all loads</div><div>of this code can’t generate alias.</div><div>running the second code, all loads haven’t alias, like you can see below:</div><div><br></div><div>for.body: ; preds = %for.cond </div><div>%idxprom = sext i32 %i.0 to i64, !dbg !35 </div><div>%arrayidx = getelementptr inbounds i32, i32* %0, i64 %idxprom, !dbg !35 </div><div>store i32 %i.0, i32* %arrayidx, align 4, !dbg !36 </div><div>br label %for.inc, !dbg !35 </div><div><br></div><div>I need to reduce the number of alias in the code.</div><div><br></div><div>I’ve tried to use this flags:</div><div><br></div><div>-mem2reg</div><div>-basicaa</div><div>-globalsmodref-aa</div><div>-tbaa </div><div>-scev-aa</div><div>-adce</div><div>-licm</div><div>-argpromotion</div><div>-gvn</div><div>-memcpyopt</div><div>-dse</div><div>-print-alias-sets</div><div>-count-aa</div><div>-aa-eval</div><div><br></div><div>Regards,</div><div><br></div><div> Gleison</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-02-02 15:59 GMT-02:00 Caldarale, Charles R <span dir="ltr"><<a href="mailto:Chuck.Caldarale@unisys.com" target="_blank">Chuck.Caldarale@unisys.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> From: llvm-dev [mailto:<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>]<br>
> On Behalf Of mats petersson via llvm-dev<br>
> Subject: Re: [llvm-dev] Particular type of loop optimization<br>
<span><br>
> I would have thought that [once it gets optimised enough], the compiler does that, or<br>
> something similar anyway [in particular `*aux++ = i;` would be what I'd expect to see].<br>
<br>
</span>Such an optimization cannot be made unless the compiler knows that the area spanned by the accesses through vectorE does not include the location of vectorE itself. Some TBAA information added to the IR-level loads and stores should allow that.<br>
<br>
- Chuck<br>
<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>