You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When investigating the cause of large binary sizes, even with -O, I found that at least one of my functions, do_insn, is about 64K all by itself, despite being not all that complicated (even after inlining): decompiling the binary code with Hex-Rays shows that the vast majority of it is extremely repetitive drop glue, which seems like it's being inappropriately inlined. This does not happen without -O.
Frankly... this is a mess. When I tried to reduce the code in even small ways, the blowup stopped happening: making i_phi#[inline(never)] reduces the total size of the binary by some 60K, while changing the implementation of get to unimplemented!() drastically reduces the size of do_insneven if it's marked inline(never). Faced with this, I'm not really sure what to do other than post the random WIP crappy code I'm working on and hope that a general issue can be identified without looking too closely. I know this is the worst possible thing to receive as a bug report, but for now that's the best I can do.
Is there any way to inline(never) drop glue? If not, it would be nice to have.
The text was updated successfully, but these errors were encountered:
comex
changed the title
rustc wantonly inlines drop glue with -O produces the equivalent of ~10,000 lines of C (with -O) as drop glue for a relatively small function
rustc wantonly inlines drop glue with -O
Nov 11, 2014
When investigating the cause of large binary sizes, even with -O, I found that at least one of my functions,
do_insn
, is about 64K all by itself, despite being not all that complicated (even after inlining): decompiling the binary code with Hex-Rays shows that the vast majority of it is extremely repetitive drop glue, which seems like it's being inappropriately inlined. This does not happen without -O.Frankly... this is a mess. When I tried to reduce the code in even small ways, the blowup stopped happening: making
i_phi
#[inline(never)]
reduces the total size of the binary by some 60K, while changing the implementation ofget
tounimplemented!()
drastically reduces the size ofdo_insn
even if it's markedinline(never)
. Faced with this, I'm not really sure what to do other than post the random WIP crappy code I'm working on and hope that a general issue can be identified without looking too closely. I know this is the worst possible thing to receive as a bug report, but for now that's the best I can do.Is there any way to
inline(never)
drop glue? If not, it would be nice to have.https://gist.github.com/comex/24abeab6b99680b045ca contains the Hex-Rays output, the source code (although it will not build without other files), and the LLVM IR produced with -O.
The text was updated successfully, but these errors were encountered: