[Bug ipa/83411] function multiversioning should clone the entire sub-callgraph

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 4 08:01:00 GMT 2018


--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Thank you Hannes for the report and also the nice blog post.
I must agree that's sort of limitation, but I don't agree that it's limiting

1) Note that dispatch happens just once when an executable is started, dynamic
linker resolves all IFUNC indirect calls. Since that you only pay for the
indirect call. However as the target is constant, modern CPUs can predict that
very well.

2) That said it's about finding reasonable big enough code that will be entered
via MV. In your example you selected a function that does only popcount, which
is extremely small and you pay for call overhead. So finding a point like your
'loop' and using flatten attribute can guarantee the call-chain is fully
optimized. Would be interesting to come up with more examples from real

Anyway, I'm leaving for now this PR and will fix PR82625. It's obvious that
user should pay for entering of MV world just once.


More information about the Gcc-bugs mailing list