This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: List of simplifications we should perform


DJ Delorie <dj@redhat.com> writes:

> > One could even take this a step further and provide an interface
> > to allow people to write optimizer in higher-level languages. I'm
> > not sure how practical would that be, though.
> 
> (define-optimization "neg-neg"
>   [(set (match-operand:SI 0 "" "")
>         (neg:SI (neg:SI (match-operand:SI 1 "" ""))))]
>   "condition"
>   [(set (match-dup 0) (match-dup 1))]
>   "prep-statement"
>   )

Hey, that's a good idea.
I've created gensimplify, a horrific marriage of genrecog and
genemit.
given an MD file (I'm using simplify.md for right now), it generates
the necessary code do the simplification for those insns.
The syntax looks like above, except it's define_simplify instead of
define-optimization.

vvvgenerates a simplify_insn function (and friends) meant to replace
simplify_rtx.

It doesn't do recursive simplification yet. I would imagine i should
just make gensimplify call simplify_insn on operands that aren't
constants.

What's left to do:
cleanup gensimplify.c
flesh out simplify.md


-- 
"They say we're 98% water.  We're that close to drowning...
(Picks up his glass of water from the stool...)  I like to live
on the edge...
"-Steven Wright


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]