Re: [PATCH] Optimize x ? bswap(x) : 0 in tree-ssa-phiopt

2021-08-05 Thread Martin Liška
Hello. I noticed the patch caused new Clang warnings: /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/gcc/tree-ssa-phiopt.c:2586:10: warning: comparison of different enumeration types in switch statement ('combined_fn' and 'built_in_function') [-Wenum-compare-switch] /home/marx

Re: [PATCH] Optimize x ? bswap(x) : 0 in tree-ssa-phiopt

2021-08-02 Thread Richard Biener via Gcc-patches
On Sat, Jul 31, 2021 at 9:56 AM Roger Sayle wrote: > > > Many thanks again to Jakub Jelinek for a speedy fix for PR 101642. > Interestingly, that test case "bswap16(x) ? : x" also reveals a > missed optimization opportunity. The resulting "x ? bswap(x) : 0" > can be further simplified to just bsw

[PATCH] Optimize x ? bswap(x) : 0 in tree-ssa-phiopt

2021-07-31 Thread Roger Sayle
Many thanks again to Jakub Jelinek for a speedy fix for PR 101642. Interestingly, that test case "bswap16(x) ? : x" also reveals a missed optimization opportunity. The resulting "x ? bswap(x) : 0" can be further simplified to just bswap(x). Conveniently, tree-ssa-phiopt.c already recognizes/opti