public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/99785] Awful lot of time spent building gl.cc in Firefox Date: Fri, 26 Mar 2021 09:33:04 +0000 [thread overview] Message-ID: <bug-99785-4-r8Y78vzfgI@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-99785-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99785 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org Version|unknown |11.0 --- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- Did anybody check the actual output from clang as to whether it performs the desired optimizations? I only have clang 9 around and that rejects the TU (maybe there's clang specific code paths and the preprocessed source is not representative here) Inlining blend_pixels without first constant propagating 'blend_key' (I suppose at all call paths that's eventually supposed to be constant propagated somehow?) looks quite stupid given the large switch. Sure, saving %xmm around calls can have a cost but trashing icache should be worse. If all of this is auto-generated the auto-generation might also be able to improve the blend_key dispatch. Another strathegy might be to not put always_inline on everything (because that in turn will cause exponential growth) but instead inline everything into the finally important function(s) via 'flatten'. That is, you do sth like static __attribute__((always_inline)) inline void large_leaf () { /* large */ } static __attribute__((always_inline)) inline void inter1 () { large_leaf (); } static __attribute__((always_inline)) inline void inter2 () { inter1 (); inter1 (); } static __attribute__((always_inline)) inline void inter3 () { inter2 (); inter2 (); } and what you get is (intermediate) 8 copies of the large_leaf body. Which is because we inline expand from leafs rather than first inlining the small always-inline wrappers (and throwing them away before inlining into them). I suppose we could try to not inline into always-inline functions at the expense of needing to iterate on inlined always-inline bodies. Or somehow at least delay inlining large bodies into always-inline bodies. Anyway, marking such large functions as always-inline is asking for trouble.
next prev parent reply other threads:[~2021-03-26 9:33 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-03-26 7:57 [Bug c++/99785] New: " mh+gcc at glandium dot org 2021-03-26 8:26 ` [Bug c++/99785] " pinskia at gcc dot gnu.org 2021-03-26 8:27 ` pinskia at gcc dot gnu.org 2021-03-26 8:29 ` pinskia at gcc dot gnu.org 2021-03-26 8:33 ` [Bug ipa/99785] " mh+gcc at glandium dot org 2021-03-26 8:41 ` pinskia at gcc dot gnu.org 2021-03-26 8:49 ` mh+gcc at glandium dot org 2021-03-26 9:08 ` mh+gcc at glandium dot org 2021-03-26 9:27 ` pinskia at gcc dot gnu.org 2021-03-26 9:29 ` jakub at gcc dot gnu.org 2021-03-26 9:33 ` rguenth at gcc dot gnu.org [this message] 2021-03-26 9:35 ` rguenth at gcc dot gnu.org 2021-03-26 10:11 ` rguenth at gcc dot gnu.org 2021-03-26 11:16 ` rguenth at gcc dot gnu.org 2021-03-26 19:31 ` jmuizelaar at mozilla dot com 2021-03-26 21:38 ` hubicka at gcc dot gnu.org 2021-03-26 22:13 ` hubicka at gcc dot gnu.org 2021-03-31 13:32 ` rguenth at gcc dot gnu.org 2021-03-31 13:37 ` jakub at gcc dot gnu.org 2021-05-21 7:29 ` rguenth at gcc dot gnu.org 2021-05-21 9:35 ` rguenth at gcc dot gnu.org 2022-05-17 11:26 ` asolokha at gmx dot com 2022-05-17 15:09 ` jmuizelaar at mozilla dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-99785-4-r8Y78vzfgI@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).