[Bug tree-optimization/98299] Failure to optimize sub loop into modulo-based pattern

2021-01-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98299 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug tree-optimization/98299] Failure to optimize sub loop into modulo-based pattern

2020-12-15 Thread gabravier at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98299 --- Comment #3 from Gabriel Ravier --- PS: The optimization seems to already occur for simpler cases such as powers of 2, e.g. : int f1(int n) { while (n >= 64) n -= 64; return n; } is optimized into `return (n <= 63) ? n : (n

[Bug tree-optimization/98299] Failure to optimize sub loop into modulo-based pattern

2020-12-15 Thread gabravier at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98299 --- Comment #2 from Gabriel Ravier --- At the very least, it seems like a worthwhile pattern to recognize in -O3, even if only to avoid vectorizing it, i.e. have similar effects to what happens if you add `if (n >= 1000) __builtin_unreachable();`

[Bug tree-optimization/98299] Failure to optimize sub loop into modulo-based pattern

2020-12-15 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98299 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #1