[Bug tree-optimization/99142] [11 Regression] __builtin_clz match.pd transformation too greedy

2021-02-18 Thread hp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99142

Hans-Peter Nilsson  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Hans-Peter Nilsson  ---
.

[Bug tree-optimization/99142] [11 Regression] __builtin_clz match.pd transformation too greedy

2021-02-18 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99142

--- Comment #1 from CVS Commits  ---
The master branch has been updated by Hans-Peter Nilsson :

https://gcc.gnu.org/g:a2ef38b1f94dd108046e702ad46dcd8e9b34625e

commit r11-7277-ga2ef38b1f94dd108046e702ad46dcd8e9b34625e
Author: Hans-Peter Nilsson 
Date:   Tue Feb 16 22:27:53 2021 +0100

match.pd: Restrict clz cmp 0 replacement by single_use, PR99142

If we're not going to eliminate the clz, it's better for the
comparison to use that result than its input, so we don't
extend the lifetime of the input.  Also, an additional use
of the result is more likely cheaper than a compare of the
input, in particular considering that the clz may have made
available a non-zero condition matching the original use.
The "s" modifier doesn't stop this situation, as the
transformation wouldn't result in "an expression with more
than one operator"; a gating single_use condition on the
result is necessary.

gcc:
PR tree-optimization/99142
* match.pd (clz cmp 0): Gate replacement on single_use of clz
result.

gcc/testsuite:
PR tree-optimization/99142
* gcc.dg/tree-ssa/pr99142.c: New test.

[Bug tree-optimization/99142] [11 Regression] __builtin_clz match.pd transformation too greedy

2021-02-18 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99142

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
   Keywords||missed-optimization

[Bug tree-optimization/99142] [11 Regression] __builtin_clz match.pd transformation too greedy

2021-02-17 Thread hp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99142

Hans-Peter Nilsson  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |hp at gcc dot gnu.org
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2021-02-17