missing info in `-print-before-all -print-after-all`

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

missing info in `-print-before-all -print-after-all`

Kristóf Umann via cfe-dev
Hello,
I'm trying to run this through opt to see where a problematic change
is being made:
https://gist.github.com/nickdesaulniers/73aef95e9735a50765f654ebdcbb99dd

I'm running this as:
opt -O2 -print-before-all -print-after-all -verify-each
generic.get_fixed_ranges.ll -S -o - 2>&1 | less

Near
*** IR Dump Before MergedLoadStoreMotion ***
for the function
@get_fixed_ranges
I see a problematic callbr instruction:
callbr void asm sideeffect "1:.byte
0x0f,0x1f,0x44,0x00,0\0A\09.pushsection __jump_table,  \22aw\22 \0A\09
.balign 8 \0A\09.long 1b - ., ${2:l} - . \0A\09 .quad ${0:c} + ${1:c}
- .\0A\09.popsection \0A\09",
"i,i,X,~{dirflag},~{fpsr},~{flags}"(%struct.static_key* getelementptr
inbounds (%struct.tracepoint, %struct.tracepoint*
@__tracepoint_read_msr, i64 0, i32 1), i1 false, i8*
blockaddress(@get_fixed_ranges, %20)) #6
          to label %native_read_msr.exit31.1 [label %49], !srcloc !4

The thing is, I can't find where this was introduced.  I would have
expected it to be printed AFTER the result of some previous pass, but
the previous pass looks like `Unroll loops`.

I would have expected some pass to muck this up, at which point it
would appear in an "AFTER" print out.  What I don't understand is that
this bad transform first appears in a "BEFORE" transform printout.

Am I holding it wrong?
--
Thanks,
~Nick Desaulniers
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: missing info in `-print-before-all -print-after-all`

Kristóf Umann via cfe-dev
Ah, I think my problem is due to loop unrolling.  So I guess the bug
is that loop unrolling doesn't print it's after results, ie.
the is no after corresponding to:
*** IR Dump Before Unroll loops ***
ie.
*** IR Dump After Unroll loops *** (is not printed)

On Tue, Jul 2, 2019 at 10:03 AM Nick Desaulniers
<[hidden email]> wrote:

>
> Hello,
> I'm trying to run this through opt to see where a problematic change
> is being made:
> https://gist.github.com/nickdesaulniers/73aef95e9735a50765f654ebdcbb99dd
>
> I'm running this as:
> opt -O2 -print-before-all -print-after-all -verify-each
> generic.get_fixed_ranges.ll -S -o - 2>&1 | less
>
> Near
> *** IR Dump Before MergedLoadStoreMotion ***
> for the function
> @get_fixed_ranges
> I see a problematic callbr instruction:
> callbr void asm sideeffect "1:.byte
> 0x0f,0x1f,0x44,0x00,0\0A\09.pushsection __jump_table,  \22aw\22 \0A\09
> .balign 8 \0A\09.long 1b - ., ${2:l} - . \0A\09 .quad ${0:c} + ${1:c}
> - .\0A\09.popsection \0A\09",
> "i,i,X,~{dirflag},~{fpsr},~{flags}"(%struct.static_key* getelementptr
> inbounds (%struct.tracepoint, %struct.tracepoint*
> @__tracepoint_read_msr, i64 0, i32 1), i1 false, i8*
> blockaddress(@get_fixed_ranges, %20)) #6
>           to label %native_read_msr.exit31.1 [label %49], !srcloc !4
>
> The thing is, I can't find where this was introduced.  I would have
> expected it to be printed AFTER the result of some previous pass, but
> the previous pass looks like `Unroll loops`.
>
> I would have expected some pass to muck this up, at which point it
> would appear in an "AFTER" print out.  What I don't understand is that
> this bad transform first appears in a "BEFORE" transform printout.
>
> Am I holding it wrong?
> --
> Thanks,
> ~Nick Desaulniers



--
Thanks,
~Nick Desaulniers
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: missing info in `-print-before-all -print-after-all`

Kristóf Umann via cfe-dev
Hi Nick,

Here's my two cents:
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.

HTH,

Son Tuan Vu


On Tue, Jul 2, 2019 at 7:25 PM Nick Desaulniers via cfe-dev <[hidden email]> wrote:
Ah, I think my problem is due to loop unrolling.  So I guess the bug
is that loop unrolling doesn't print it's after results, ie.
the is no after corresponding to:
*** IR Dump Before Unroll loops ***
ie.
*** IR Dump After Unroll loops *** (is not printed)

On Tue, Jul 2, 2019 at 10:03 AM Nick Desaulniers
<[hidden email]> wrote:
>
> Hello,
> I'm trying to run this through opt to see where a problematic change
> is being made:
> https://gist.github.com/nickdesaulniers/73aef95e9735a50765f654ebdcbb99dd
>
> I'm running this as:
> opt -O2 -print-before-all -print-after-all -verify-each
> generic.get_fixed_ranges.ll -S -o - 2>&1 | less
>
> Near
> *** IR Dump Before MergedLoadStoreMotion ***
> for the function
> @get_fixed_ranges
> I see a problematic callbr instruction:
> callbr void asm sideeffect "1:.byte
> 0x0f,0x1f,0x44,0x00,0\0A\09.pushsection __jump_table,  \22aw\22 \0A\09
> .balign 8 \0A\09.long 1b - ., ${2:l} - . \0A\09 .quad ${0:c} + ${1:c}
> - .\0A\09.popsection \0A\09",
> "i,i,X,~{dirflag},~{fpsr},~{flags}"(%struct.static_key* getelementptr
> inbounds (%struct.tracepoint, %struct.tracepoint*
> @__tracepoint_read_msr, i64 0, i32 1), i1 false, i8*
> blockaddress(@get_fixed_ranges, %20)) #6
>           to label %native_read_msr.exit31.1 [label %49], !srcloc !4
>
> The thing is, I can't find where this was introduced.  I would have
> expected it to be printed AFTER the result of some previous pass, but
> the previous pass looks like `Unroll loops`.
>
> I would have expected some pass to muck this up, at which point it
> would appear in an "AFTER" print out.  What I don't understand is that
> this bad transform first appears in a "BEFORE" transform printout.
>
> Am I holding it wrong?
> --
> Thanks,
> ~Nick Desaulniers



--
Thanks,
~Nick Desaulniers
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: missing info in `-print-before-all -print-after-all`

Kristóf Umann via cfe-dev
On Wed, Jul 3, 2019 at 1:21 AM Son Tuan VU <[hidden email]> wrote:
>
> Hi Nick,
>
> Here's my two cents:
> 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.


Makes sense, thanks!

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



--
Thanks,
~Nick Desaulniers
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev