This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: Constant propagation and strength reduction


On Tue, 21 Jan 2003, Dale Johannesen wrote:
> On Tuesday, January 21, 2003, at 10:22  AM, David Edelsohn wrote:
> > 	There already was a proposal to retry the divmod case later that
> > was rejected, mentioning that this will be fixed by Tree-SSA.  I tend
> > to agree that duplicating the code is the wrong design.
>
> That was mine I think; basically cprop_insn calls back into
> expand_divmod. I can resubmit this patch if anyone's interested.

Hi Dale,

I've found your original patch at:
http://gcc.gnu.org/ml/gcc-patches/2001-10/msg01434.html

I like it a lot.  My one suggestion is the break out the logic
into a function "simplify_insn" and put that in simplify-rtx.c.

There are obviously RTL optimizations that operate on an entire
instruction, potentially replacing it with multiple instructions.
These transformations are inappropriate for simplify_rtx, which
only handles expressions.

Having a simplify_insn would allow us to place other optimizations
there, such as multiplications into sequences of shifts and additions,
tablejumps into if-the-else binary trees, etc.. and allow this routine
to be re-used by other passes, including CSE and cselib.

Yes, please resubmit.  Hopefully, it'll get approved in its new form.

Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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