[Bug rtl-optimization/107455] Suboptimal codegen for some branch-on-zero cases

2022-11-16 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107455

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||law at gcc dot gnu.org

--- Comment #3 from Jeffrey A. Law  ---
This looks like the problem I was chasing down a month or so ago.  I've
actually got all the review comments addressed and just need to resubmit.

Basically what we need is to take advantage of conditional equivalences
post-reload.

[Bug rtl-optimization/107455] Suboptimal codegen for some branch-on-zero cases

2022-10-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107455

--- Comment #2 from Andrew Pinski  ---
Note GCC does this optimization at the gimple level some of the times when it
comes to the same type.
Witness:
int x (int t)
{
  if (t & 256)
return -26;
  return 0;
}

[Bug rtl-optimization/107455] Suboptimal codegen for some branch-on-zero cases

2022-10-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107455

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2022-10-29
 Status|UNCONFIRMED |NEW

--- Comment #1 from Andrew Pinski  ---
Interesting that powerpc64le with clang is much much worse than aarch64. I
would assume they would have a similar code generation. GCC produces similar
for aarch64 and powerpc64le and riscv.

Confirmed. There might be other bugs recording a similar thing.

[Bug rtl-optimization/107455] Suboptimal codegen for some branch-on-zero cases

2022-10-29 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107455

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization
   Severity|normal  |enhancement