<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 5, 2016 at 10:16 AM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Jun 4, 2016, at 9:44 PM, vivek pandya <<a href="mailto:vivekvpandya@gmail.com" target="_blank">vivekvpandya@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 5, 2016 at 9:15 AM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On Jun 4, 2016, at 8:32 PM, vivek pandya <<a href="mailto:vivekvpandya@gmail.com" target="_blank">vivekvpandya@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 5, 2016 at 8:56 AM, Mehdi Amini <span dir="ltr"><<a href="mailto:mehdi.amini@apple.com" target="_blank">mehdi.amini@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><br>
> On Jun 4, 2016, at 7:56 PM, vivek pandya <<a href="mailto:vivekvpandya@gmail.com" target="_blank">vivekvpandya@gmail.com</a>> wrote:<br>
><br>
> Hello Mehdi Amini,<br>
><br>
> Sorry for slow progress this week but it was due to interesting mistake of mine. I had build llvm with ipra enable by default and that build files were on my path ! Due to that next time I tried to build llvm it was terribly slow  (almost 1 hour for 10% build ). I spend to much time on fixing this by playing around with environment variables, cmake options etc.<br>
> But I think this is a serious concern, we need to think verify this time complexity other wise building a large software with IPRA enable would be very time consuming.<br>
<br>
</span>Did you build your own clang in release mode or debug? That makes a very important difference...<br></blockquote><div>oh yes nice point, what I did is Debug mode with IPRA 😬 that is insane. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><br>
><br>
> I studied tets case suggest by you on phabricator, for RegUsageInfo passes I am thinking to print clobbered registers and verify that with FileCheck as expected clobbered register for a particular test-case. Is this approach fine?<br>
><br>
> I did not find function call to CostModelAnalysis::print() , Is opt -analyze making that call ?<br>
<br>
</span>Yes.<br>
(In general, if you find yourself in a situation where you can find the caller for a function, run in a debugger and set a breakpoint)<br></blockquote><div>Ok </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><br>
> I am not able to find similar option in llc.<br>
<br>
</span>That's an issue. Looks it may not be feasible to test the analysis in llc with the current infrastructure.<br>
<span><br></span></blockquote><div>I got the trick, actaully I am trying to do the same thing but let me figure out why it does not work? </div><div>./print-machineinstrs.ll:; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs=branch-folder -o /dev/null 2>&1 | FileCheck %s</div><div>./print-machineinstrs.ll:; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs -o /dev/null 2>&1 | FileCheck %s</div><div>./print-machineinstrs.ll:; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs= -o /dev/null 2>&1 | FileCheck %s </div></div></div></div></div></blockquote><div></div></span></div></div></blockquote><div>The above example I found in test directory it feeds the .s file to /dev/null and binds stderr to stdout so that FileCheck will have debug info printed as input to work on. </div></div></div></div></div></blockquote><div><br></div></span><div>We could indeed add the dump of the analysis results in doFinalization(), behind a cl::opt.</div></div></div></blockquote><div>Sorry I didn't get that. Please elaborate. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- </div><div>Mehdi</div></font></span><div><div class="h5"><div><br></div><div><br></div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span><div> <br></div></span></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span><div></div></span><div>I'm not sure what you're doing here, but considering that llc does not expose -analyze, I'd just keep it all in a single patch as originally planned.</div><span><font color="#888888"><div><br></div><div>-- </div><div>Mehdi</div></font></span><div><div><div><br></div><div><br></div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
> I can't use info printed with dbgs() function as release build do not add -debug-only option to llc executable.<br>
><br>
> For the testcase sent by you earlier I have modified it as following :<br>
> ;;;;; ip-regallco-simple.ll<br>
> ; RUN: llc < %s | FileCheck %s -check-prefix=NOIPRA<br>
> ; RUN: llc < %s -enable-ipra | FileCheck %s<br>
> ; NOIPRA: foo:<br>
<br>
</span>should be NOIPRA-LABEL:<br>
<span><br>
> ; NOIPRA: pushq       %r10<br>
> ; NOIPRA: pushq       %r9<br>
> ; NOIPRA: pushq       %r8<br>
</span>> ; NOIPRA: calls bar1<br>
<br>
If this is an exact sequence you want to match, you may use NOIPRA-NEXT </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><br>
> ; CHECK: foo:<br>
> ; CHECK-NOT: pushq %r10<br>
> ; CHECK-NOT: pushq %r9<br>
> ; CHECK-NOT: pushq %r8<br>
<br>
</span>You can just write "CHECK-NOT: push"<br>
<span><br>
> ; CHECK: callq bar1<br>
> target triple = "x86_64-unknown-unknown"<br>
> define void @bar1() {<br>
>       ret void<br>
> }<br>
> define preserve_allcc void @foo()#0 {<br>
>       call void @bar1()<br>
>       call void @bar2()<br>
>       ret void<br>
> }<br>
> define void @bar2() {<br>
>       ret void<br>
> }<br>
> attributes #0 = {nounwind}<br>
><br>
> Is this correct approach to verify spills?<br>
<br>
</span>Yes.<br>
<span><font color="#888888"><br>
<br>
--<br>
Mehdi<br>
<br>
</font></span></blockquote></div><br></div></div>
</div></blockquote></div></div></div><br></div></blockquote></div><br></div></div>
</div></blockquote></div></div></div><br></div></blockquote></div><br></div></div>