Hacker News new | ask | show | jobs
by lopsidedBrain 2348 days ago
GCC does this too fwiw. Whether or not it is considered a bug, it doesn't have one particular root cause. Several common optimization passes assume small function body. Since functions are typically small, many optimizations use this as a window for heavyweight passes.

In other words, intraprocedural optimisation has always been more aggressive than interprocedural optimisation. If you try inlining every function ever into one giant function, you'll be forced to scale back optimization levels.

1 comments

There seems to be space for middle ground available then...

   if IR_count > ...
     warn "Can't run optimiser ... pass on {func} (too large)"
   else
     run_pass
I can't speak for the toolchain maintainers. But with appropriate flags to force or skip those passes, yes I can see something like this being merged in.