<div dir="ltr">Hi Sebastian, <div><br></div><div>Given that "delinerization" fails shall I file a PR in bugzilla?</div><div><br></div><div>regards,<br></div><div>Venkat,</div><br><div class="gmail_quote"><div dir="ltr">On Thu, 20 Sep 2018 at 09:57, Venkataramanan Kumar <<a href="mailto:venkataramanan.kumar.llvm@gmail.com">venkataramanan.kumar.llvm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Sebastian ,<br><br><div class="gmail_quote"><div dir="ltr">On Thu, 20 Sep 2018 at 03:57, Sebastian Pop <<a href="mailto:sebpop@gmail.com" target="_blank">sebpop@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 19, 2018 at 4:58 AM Venkataramanan Kumar <<a href="mailto:venkataramanan.kumar.llvm@gmail.com" target="_blank">venkataramanan.kumar.llvm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi, </div><div><br></div><div dir="ltr">I tired to see when this behavior changed in LLVM. </div><div dir="ltr">It seems to start from.<br></div><div dir="ltr"><div>--snip--<br></div><div><div>commit 95e5d37d5868ebde2302bc302c1e0af407c5646d</div><div>Author: Sebastian Pop <<a href="mailto:sebpop@gmail.com" target="_blank">sebpop@gmail.com</a>></div><div>Date:   Tue Mar 6 21:55:59 2018 +0000</div><div><br></div><div>    DA: remove uses of GEP, only ask SCEV</div><div>--snip--</div><div><br></div><div><a href="https://reviews.llvm.org/D35430" target="_blank">https://reviews.llvm.org/D35430</a><br></div><div>Review URL says "GEP" based approach was wrong for multidimensional array references. The LLVM-DA now uses SCEV representation.  But why we are not getting the distance with SCEV?  Current DA will not work for multidimensional arrays?</div></div></div></div></div></blockquote><div><br></div><div>It should work with delinearization of multi-dim arrays.</div></div></div></blockquote><div>I thought "delinearization"  is enabled by default on trunk now.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><br></div><div>I need to get dependence distance for a transformation that I am working on.  How do I get distance for such cases, esp multidimensional arrays? </div><div><br></div><div>Thanks and regards,</div><div>Venkat.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, 18 Sep 2018 at 19:00, Venkataramanan Kumar <<a href="mailto:venkataramanan.kumar.llvm@gmail.com" target="_blank">venkataramanan.kumar.llvm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>Hi, </div><div><br></div><div>For the below test case, I need the dependence distance between the array references  "a[j][i]"  and "a[j-1][i-2]".</div><div><br></div><div>--Snip--</div><div>int a[5][5];</div><div>int b[10];</div><div><br></div><div>void test()</div><div>{</div><div>        for (int j=1;j<5;j++)</div><div>                for (int i=2;i<5;i++)</div><div>                {</div><div>                        a[j][i] = 3.0;</div><div>                        b[i]= a[j-1][i-2] ;</div><div>                }</div><div>}</div><div>--Snip-</div><div><br></div><div>Compile steps </div><div>clang -O1 -emit-llvm -S test.c</div><div>opt  -analyze -da dist.ll</div><div><br></div></div></div></blockquote></div></div></div></div></div></blockquote><div><br></div><div>you are missing the -delinearize flag to opt.</div></div></div></blockquote><div>Tried this flag and I am getting </div><div>opt -analyze -delinearize -da  dist.ll<br></div><div>--Snip--</div><div><div>Delinearization on function test:</div><div>Inst:  %arrayidx6 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* @a, i64 0, i64 %indvars.iv30, i64 %indvars.iv<br></div><div>In Loop with Header: for.body4</div><div>AccessFunction: 0</div><div>failed to delinearize</div><div><br></div><div>Inst:  %arrayidx6 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* @a, i64 0, i64 %indvars.iv30, i64 %indvars.iv</div><div>In Loop with Header: for.cond1.preheader</div><div>AccessFunction: 0</div><div>failed to delinearize</div></div><div>.....</div><div>--Snip--</div><div><br></div><div>regards.</div><div>Venkat. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div></div><div>I tried dumping the dependence information with LLVM trunk (2018_09_17), it shows: </div><div><br></div><div>Printing analysis 'Dependence Analysis' for function 'test':<br></div><div>da analyze - none!</div><div>da analyze - flow [< <>]! <== dumps direction vector</div><div>da analyze - none!</div><div>da analyze - none!</div><div>da analyze - none!</div><div>da analyze - consistent output [S 0]!</div><div><br></div><div>LLVM Release 6.0.1 dumps the expected distance. </div><div>Printing analysis 'Dependence Analysis' for function 'test':</div><div>da analyze - none!</div><div>da analyze - consistent flow [1 2]!</div><div>da analyze - none!</div><div>da analyze - none!</div><div>da analyze - none! </div><div>da analyze - consistent output [S 0]!</div><div><br></div><div>In trunk, it is now showing directions instead of distances. </div><div>How to get the dependence distance?</div><div><br></div><div>regards,</div><div>Venkat.</div></div></div>
</blockquote></div></div></div></div></div>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div></div>