[Bug tree-optimization/126969] If x is racecar (known to be 0 or all-ones), bitreverse (x) -> x

"jakub at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126969

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I'm not sure this is common enough to bother.
That said, if you want to bother, the way to deal with this is check if range
of the argument is a union of singleton ranges (i.e. [a,a][b,b][c,c][d,d]) and
for each of the arguments the operation (I think BITREVERSE, BSWAP and rotates
by constant amount come to my mind as candidates) for all the values result in
identity.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.