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: [PATCH] Fix up cprop to canonicalize PLUS/MINUS with 2 CONSTANT_P arguments (PR rtl-optimization/57915)


On 02/01/14 02:58, Jakub Jelinek wrote:
I think AND is necessary for certain variants of the Alpha.  In
theory a shift-add might be possible here, but I don't know if it
happens in practice.

Well, from what I can read in simplify-rtx.c, it only adds CONST around
PLUS/MINUS, not around anything else.
True. But is that the only place that creates the expressions? I'd certainly agree that PLUS is by far the most important. I've never the other forms, but those are more likely an artifact of the ports I've worked on through the years.





Anyway, another variant would be (untested so far) say following patch.

BTW, I wonder why each pass rolls it's own kind of simplification, e.g.
fwprop has propagate_rtx_1, cprop this function, etc., while we have
simplify_replace_fn_rtx that would be used perhaps with some hook that will
handle special cases for each of the pass, but otherwise will take care of
simplifying everything that has actually changed.  But that is likely not
what we want to change in stage4.
Some is certainly historical. Even just unifying the simplifications in combine and simplify_rtx would be a big (but useful) change. Agreed it's not stage4 material.



2014-02-01  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/57915
	* recog.c (simplify_while_replacing): If all unary/binary/relational
	operation arguments are constant, attempt to simplify those.

	* gcc.target/i386/pr57915.c: New test.
Looks good to me.

Jeff


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