[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2024-03-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 --- Comment #10 from Andrew Pinski --- Here is some more optimizations where the inner CMP is not EQ/NE: signed: x == (x <= CST) -> CST == 0 ? false : CST < 0 ? x == 0 : x == 1 x == (x < CST) -> CST == 1 ? false : CST <= 0 ? x == 0 : x == 1

[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2023-09-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 --- Comment #9 from Andrew Pinski --- Actually here is the rest for the non-zero comparisons. Note for the below case, s can be swapped around with unsigned and the CST comparisons become unsigned comparisons too. s < (s == CST) -> CST == 0

[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2023-09-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 --- Comment #8 from Andrew Pinski --- Created attachment 55889 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55889=edit Runtime test

[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2023-07-13 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 --- Comment #7 from Andrew Pinski --- Half of this is fixed now.

[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2023-07-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 --- Comment #6 from CVS Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:285c9d042e90a7425b37697edc9ec93a1b03b486 commit r14-2501-g285c9d042e90a7425b37697edc9ec93a1b03b486 Author: Andrew Pinski Date:

[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2023-07-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 --- Comment #5 from Andrew Pinski --- Part 1 of the patch to fix this: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624293.html This weekend I will handle the outer != NE/EQ cases.

[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2023-07-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 --- Comment #4 from Andrew Pinski --- Created attachment 55527 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55527=edit the eq/ne based functions

[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2023-07-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Ever confirmed|0

[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2023-06-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 --- Comment #2 from Andrew Pinski --- Some more generally for the ==/!= cases for CSTs: x == (x == CST) -> CST == 0 ? 0 : (CST == 1 ? (x==0||x==1) : x != 0) x == (x != CST) -> CST == 1 ? 0 : (CST == 0 ? (x==0||x==1) : x != 1) x != (x == CST) ->

[Bug tree-optimization/110293] Some `A CMP (A NEEQ 0)` is not simplified in some cases

2023-06-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110293 --- Comment #1 from Andrew Pinski --- Here are the signed versions of />=: `s < (s != 0)` is `s < 0` `s <= (s != 0)` is `s <= 1` `s > (s != 0)` is `s > 1` `s >= (s != 0)` is `s >= 0` `s < (s == 0)` is `s <= 0` `s <= (s == 0)` is `s <= 0`