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

* [Bug tree-optimization/61110] Simplify value_replacement in phiopt
  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 ` glisse at gcc dot gnu.org
  2014-11-05 16:11 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-05-17 12:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> ---
Another extension is discussed here:
https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00704.html
(also transform if there is a second phi but it could be turned into a cmove)


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

* [Bug tree-optimization/61110] Simplify value_replacement in phiopt
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-11-05 16:11 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |25290

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think some of this should really be moved to match.pd and phi-opt use it
instead.


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

* [Bug tree-optimization/61110] Simplify value_replacement in phiopt
  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
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-31  5:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Mine working on this.

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

* [Bug tree-optimization/61110] Simplify value_replacement in phiopt
  2014-05-08 13:40 [Bug tree-optimization/61110] New: Simplify value_replacement in phiopt glisse at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-02 21:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 58089
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58089&action=edit
Start of rewriting value_replacement to use match-and-simplify

This is a start and does not remove the old code. It has a few small
regressions due to not being able to merge the bb when doing the replacement.
this is something which I am working on but I am posting it here as I stopping
to work on this for a month or so but will come back to it.

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

* [Bug tree-optimization/61110] Simplify value_replacement in phiopt
  2014-05-08 13:40 [Bug tree-optimization/61110] New: Simplify value_replacement in phiopt glisse at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-05-02 21:47 ` pinskia at gcc dot gnu.org
@ 2024-05-07 21:43 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-07 21:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61110
Bug 61110 depends on bug 114894, which changed state.

Bug 114894 Summary: `a == 0 ? 0 : a * b` -> `a * b` likewise for `a & b`
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114894

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

^ 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).