<div dir="ltr"><div>Hi Nick,</div><div><br></div><div>Here's my two cents:<br></div><div>Loop unrolling is a loop pass so it would print the loop after its run. However, loop unrolling deletes the loop if it is completely unrolled, that's why loop unrolling doesn't print anything after its run.</div><div><br></div><div>HTH,<br></div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Son Tuan Vu</div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 2, 2019 at 7:25 PM Nick Desaulniers via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</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">Ah, I think my problem is due to loop unrolling.  So I guess the bug<br>
is that loop unrolling doesn't print it's after results, ie.<br>
the is no after corresponding to:<br>
*** IR Dump Before Unroll loops ***<br>
ie.<br>
*** IR Dump After Unroll loops *** (is not printed)<br>
<br>
On Tue, Jul 2, 2019 at 10:03 AM Nick Desaulniers<br>
<<a href="mailto:ndesaulniers@google.com" target="_blank">ndesaulniers@google.com</a>> wrote:<br>
><br>
> Hello,<br>
> I'm trying to run this through opt to see where a problematic change<br>
> is being made:<br>
> <a href="https://gist.github.com/nickdesaulniers/73aef95e9735a50765f654ebdcbb99dd" rel="noreferrer" target="_blank">https://gist.github.com/nickdesaulniers/73aef95e9735a50765f654ebdcbb99dd</a><br>
><br>
> I'm running this as:<br>
> opt -O2 -print-before-all -print-after-all -verify-each<br>
> generic.get_fixed_ranges.ll -S -o - 2>&1 | less<br>
><br>
> Near<br>
> *** IR Dump Before MergedLoadStoreMotion ***<br>
> for the function<br>
> @get_fixed_ranges<br>
> I see a problematic callbr instruction:<br>
> callbr void asm sideeffect "1:.byte<br>
> 0x0f,0x1f,0x44,0x00,0\0A\09.pushsection __jump_table,  \22aw\22 \0A\09<br>
> .balign 8 \0A\09.long 1b - ., ${2:l} - . \0A\09 .quad ${0:c} + ${1:c}<br>
> - .\0A\09.popsection \0A\09",<br>
> "i,i,X,~{dirflag},~{fpsr},~{flags}"(%struct.static_key* getelementptr<br>
> inbounds (%struct.tracepoint, %struct.tracepoint*<br>
> @__tracepoint_read_msr, i64 0, i32 1), i1 false, i8*<br>
> blockaddress(@get_fixed_ranges, %20)) #6<br>
>           to label %native_read_msr.exit31.1 [label %49], !srcloc !4<br>
><br>
> The thing is, I can't find where this was introduced.  I would have<br>
> expected it to be printed AFTER the result of some previous pass, but<br>
> the previous pass looks like `Unroll loops`.<br>
><br>
> I would have expected some pass to muck this up, at which point it<br>
> would appear in an "AFTER" print out.  What I don't understand is that<br>
> this bad transform first appears in a "BEFORE" transform printout.<br>
><br>
> Am I holding it wrong?<br>
> --<br>
> Thanks,<br>
> ~Nick Desaulniers<br>
<br>
<br>
<br>
-- <br>
Thanks,<br>
~Nick Desaulniers<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>