From: Dmitry Mikushin <dmitry@kernelgen.org>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: David Edelsohn <dje.gcc@gmail.com>, Jeffrey Law <law@redhat.com>,
Qing Zhao <QING.ZHAO@oracle.com>, GCC <gcc@gcc.gnu.org>
Subject: Re: Does gcc automatically lower optimization level for very large routines?
Date: Fri, 20 Dec 2019 23:00:00 -0000 [thread overview]
Message-ID: <CAJoDaPaAP_STAROba1T95JYdmkhko+Ettn11asX5WqkaD5t4RA@mail.gmail.com> (raw)
In-Reply-To: <20191220225203.GI3152@gate.crashing.org>
Yes, much more. When you traverse a CFG, the analysis develops into a tree
(for example a tree of uses). That is, every basic block could be
*recursively* a root of an individual linear iteration for up to all basic
blocks. Sum them up, and you will get a polynomial expression. I don't
insist that this is the best way, but often the way it is.
пт, 20 дек. 2019 г. в 23:52, Segher Boessenkool <segher@kernel.crashing.org
>:
> On Fri, Dec 20, 2019 at 02:57:57AM +0100, Dmitry Mikushin wrote:
> > Trying to plan memory consumption ahead-of-work contradicts with the
> nature
> > of the graph traversal. Estimation may work very well for something
> simple
> > like linear or log-linear behavior.
>
> Almost everything we do is (almost) linear.
>
> > But many compiler algorithms are known
> > to be polynomial or exponential
>
> Many? There are a few (register allocation is a well-known example),
> but anything more than almost linear is quite easy to make blow up. It
> is also not super hard in most cases to make things linear, it just
> needs careful attention.
>
> > (or even worse in case of bugs).
>
> Well, sure, if there is a bug *anything* can go wrong ;-)
>
>
> Segher
>
next prev parent reply other threads:[~2019-12-20 23:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-19 16:37 Qing Zhao
2019-12-19 22:51 ` Dmitry Mikushin
2019-12-19 23:07 ` Qing Zhao
2019-12-20 0:41 ` Jeff Law
2019-12-20 1:32 ` David Edelsohn
2019-12-20 1:58 ` Dmitry Mikushin
2019-12-20 22:52 ` Segher Boessenkool
2019-12-20 23:00 ` Dmitry Mikushin [this message]
2019-12-20 11:13 ` Richard Biener
2019-12-20 16:05 ` Qing Zhao
2019-12-20 16:22 ` Jonathan Wakely
2020-01-01 5:25 ` Andi Kleen
2020-01-01 15:20 ` Segher Boessenkool
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=CAJoDaPaAP_STAROba1T95JYdmkhko+Ettn11asX5WqkaD5t4RA@mail.gmail.com \
--to=dmitry@kernelgen.org \
--cc=QING.ZHAO@oracle.com \
--cc=dje.gcc@gmail.com \
--cc=gcc@gcc.gnu.org \
--cc=law@redhat.com \
--cc=segher@kernel.crashing.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: link
Be 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).