public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61110] New: Simplify value_replacement in phiopt
@ 2014-05-08 13:40 glisse at gcc dot gnu.org
  2014-05-17 12:48 ` [Bug tree-optimization/61110] " glisse at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-05-08 13:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61110

            Bug ID: 61110
           Summary: Simplify value_replacement in phiopt
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org

The patch for PR 59100 introduced 2 functions neutral_element_p and
absorbing_element_p. I don't know why I did that. When we see:
(x != 0) ? x + y : y
instead of asking if 0 is a neutral element of + on the left, it is easier to
try to fold "0 + y" (I replaced x with the rhs of the comparison) and check if
that matches "y". This handles neutral and absorbing as a single case and is
even more general (we could also do it for the non-constant case: (x!=y) ? x|y
: x). We could even imagine generalizing it to the case where middle_bb has 2
or 3 statements (but the cost analysis may need to be refined then).

I probably won't do it immediately (the current code works) but I didn't want
this idea to be forgotten.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-07 21:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-08 13:40 [Bug tree-optimization/61110] New: Simplify value_replacement in phiopt glisse at gcc dot gnu.org
2014-05-17 12:48 ` [Bug tree-optimization/61110] " glisse at gcc dot gnu.org
2014-11-05 16:11 ` pinskia at gcc dot gnu.org
2023-10-31  5:08 ` pinskia at gcc dot gnu.org
2024-05-02 21:47 ` pinskia at gcc dot gnu.org
2024-05-07 21:43 ` pinskia at gcc dot gnu.org

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 read-only IMAP folder(s) and NNTP newsgroup(s).