[cfe-dev] missing info in `-print-before-all -print-after-all`

Nick Desaulniers via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 2 10:03:52 PDT 2019


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



More information about the cfe-dev mailing list