[Bug tree-optimization/112104] loop of ^1 should just be reduced to ^(n&1)

2023-11-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112104

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|14.0|---

[Bug tree-optimization/112104] loop of ^1 should just be reduced to ^(n&1)

2023-11-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112104

Andrew Pinski  changed:

   What|Removed |Added

 Status|RESOLVED|NEW
 Resolution|FIXED   |---

--- Comment #6 from Andrew Pinski  ---
(In reply to Hongtao.liu from comment #5)
> (In reply to Andrew Pinski from comment #4)
> > Fixed via r14-5428-gfd1596f9962569afff6c9298a7c79686c6950bef .
> 
> Note, my patch only handles constant tripcount for XOR, but not do the
> transformation when tripcount is variable.

Oh.

[Bug tree-optimization/112104] loop of ^1 should just be reduced to ^(n&1)

2023-11-14 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112104

--- Comment #5 from Hongtao.liu  ---
(In reply to Andrew Pinski from comment #4)
> Fixed via r14-5428-gfd1596f9962569afff6c9298a7c79686c6950bef .

Note, my patch only handles constant tripcount for XOR, but not do the
transformation when tripcount is variable.

[Bug tree-optimization/112104] loop of ^1 should just be reduced to ^(n&1)

2023-11-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112104

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED
   Target Milestone|--- |14.0

--- Comment #4 from Andrew Pinski  ---
Fixed via r14-5428-gfd1596f9962569afff6c9298a7c79686c6950bef .

[Bug tree-optimization/112104] loop of ^1 should just be reduced to ^(n&1)

2023-10-30 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112104

--- Comment #3 from Hongtao.liu  ---
We already have analyze_and_compute_bitop_with_inv_effect, but it only works
when inv is an SSA_NAME, it should be extended to constant.

[Bug tree-optimization/112104] loop of ^1 should just be reduced to ^(n&1)

2023-10-27 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112104

Richard Biener  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2023-10-27
 Status|UNCONFIRMED |NEW

--- Comment #2 from Richard Biener  ---
Confirmed.  I think it should apply even to

int
foo(long n3, int j, int x) {
  for(int i=0; i

[Bug tree-optimization/112104] loop of ^1 should just be reduced to ^(n&1)

2023-10-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112104

--- Comment #1 from Andrew Pinski  ---
This shows up in a really really bad benchmark:
https://github.com/kdlucas/byte-unixbench/blob/master/UnixBench/src/whets.c