linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: [RFC] sparse SSA construction
Date: Mon, 7 Aug 2017 03:21:00 +0200	[thread overview]
Message-ID: <20170807012059.3xfmohmfebof4bot@ltop.local> (raw)
In-Reply-To: <CANeU7QnxyV2cXvvErVsX_7MivK5AO+7TEsxf=rCvX+seoOf94A@mail.gmail.com>

On Sun, Aug 06, 2017 at 08:33:51PM -0400, Christopher Li wrote:
> On Sun, Aug 6, 2017 at 7:44 PM, Luc Van Oostenryck wrote:
>
> >> That I am very curios how it was done. See the above
> >> question.
> >
> > IMO, the best is to read the article. My code is
> > still very close to the article's pseudo-code.
> >
> > Basically, it's a lazy approach. Things are done
> > when possible and are delayed if not.
> 
> So you are building the SSA for the memory variable
> I assume?

No, directly from symbol to pseudos.
It's the beauty of this approach.
 
> Directly from the linearize process?

Yes, only the add_load() & add_store() is modified and 
instead of storing stuff in memory, it's directly translated
to pseudos & phi-nodes are created when needed.

> > More specifically, you can do what is needed in a BB
> > once you have all the parents, otherwise you need to
> > delay things. The article call this 'BB is sealed'
> > and there is a 'seal' operation that need to be called
> > to process what was delayed.
> > Complications arise with gotos (and the article doesn't
> > talk about them) but I've added a solution for it
> > (but I would like to return to it later).
> 
> I am missing the obvious. Where is this article?

I've put the reference at the top of the new file sssa.c:
/*
 * This is an implementation of the SSA construction algorithm:
 *	"Simple and Efficient Construction of Static Single Assignment Form"
 * by Matthias Braun, Sebastian Buchwald, Sebastian Hack, Roland Leissa,
 *    Christoph Mallon and Andreas Zwinkau.
 * cfr. http://www.cdl.uni-saarland.de/papers/bbhlmz13cc.pdf
 */

> > From what I've seen/heard this algo have been pretty well
> > received. Personnaly, I'm very happy with its simplicity
> > and its result.
> 
> Great!
> 
> >
> > One thing that is missing is the more complex cases
> > with trivial phi-nodes.
> 
> Can you clarify?

It's a question of related cycles of phi-nodes.
Some can be simplified away, it's described in the article.
The simple case of a simple cycle is already handled.

> > Another thing I would like to change is the ptrmap
> > implementation I've added: it need to be hash-table based
> > (but it's only an implementation detail that matters
> > for performance on really big functions).
> 
> Which ptrmap? The one used for CSE?

No, no.
I needed a map between symbols and pseudos.
It's in a separate file: ptrmap.c

-- Luc

  reply	other threads:[~2017-08-07  1:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-06 20:26 [RFC] sparse SSA construction Luc Van Oostenryck
2017-08-06 23:01 ` Christopher Li
2017-08-06 23:44   ` Luc Van Oostenryck
2017-08-07  0:33     ` Christopher Li
2017-08-07  1:21       ` Luc Van Oostenryck [this message]
2017-08-07  1:44         ` Christopher Li
2017-08-15 13:41 ` Dibyendu Majumdar
2017-08-15 13:59   ` Christopher Li
2017-08-15 14:06     ` Dibyendu Majumdar
2017-08-15 14:07       ` Christopher Li
2017-08-15 14:09         ` Dibyendu Majumdar
2017-08-15 14:18           ` Christopher Li
2017-08-15 18:36           ` Linus Torvalds
2017-08-15 20:14             ` Luc Van Oostenryck
2017-08-15 20:43               ` Linus Torvalds
2017-08-15 21:43                 ` Luc Van Oostenryck
2017-08-15 22:44                   ` Dibyendu Majumdar
2017-08-16  5:36                     ` Christopher Li
2017-08-16  5:15                   ` Christopher Li
2017-08-16  4:23                 ` Christopher Li
2017-08-16  4:58                   ` Christopher Li
2017-08-16 10:40                     ` Dibyendu Majumdar
2017-08-16 13:17                       ` Christopher Li
2017-08-16  6:41                 ` Luc Van Oostenryck
2017-08-16 11:02               ` Dibyendu Majumdar
2017-08-16 12:00                 ` Luc Van Oostenryck
2017-08-16 12:16                   ` Dibyendu Majumdar
2017-08-16 12:23                     ` Christopher Li
2017-08-16 12:28                     ` Luc Van Oostenryck
2017-08-16 12:39                       ` Dibyendu Majumdar
2017-08-16 12:50                         ` Christopher Li
2017-08-16 12:57                           ` Dibyendu Majumdar
2017-08-16 13:11                             ` Christopher Li
2017-08-16 13:22                               ` Christopher Li
2017-08-16 12:17                   ` Christopher Li
2017-08-15 20:37             ` Luc Van Oostenryck

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=20170807012059.3xfmohmfebof4bot@ltop.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.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 NNTP newsgroup(s).