[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] add a second lightweight flow-analysis pas
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] [PATCH] add a second lightweight flow-analysis pass |
Date: |
Mon, 15 Oct 2012 21:17:35 +0200 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, Oct 12, 2012 at 07:45:44PM +0200, Felix wrote:
> This patch adds another lightweight flow-analysis pass to remove some
> unnecessary type checks after normal optimization has taken place.
>
> Even with specialization, inlining (in particular cross-module
> inlining) may result in type checks that are in many cases redundant.
> For example inlined record accessors compiled in safe mode, and
> inlining of code in general (which is done after the normal
> flow-analysis pass) will introduce type-checks that specialization
> would have (sometimes) removed.
I'm not sure I completely understand why the scrutinizer can't remove
this after inlining, but ok.
> This patch adds a new compiler pass (called "lfa2"), that does a
> simplified flow-analysis to identify redundant forms of the form
> '(##core#inline "C_i_check_..." ...)'. Type-information is obtained
> from constant forms and predicates like '(##core#inline
> "C_i_structurep" ...)'. In unsafe mode checks will be removed in
> general.
Looks good, as far as I can understand it! I've pushed the patch.
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth