[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2023-01-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 Richard Biener changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2023-01-11 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #19 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:f99d7d669eaa2830eb5878df4da67e77ec791522 commit r13-5106-gf99d7d669eaa2830eb5878df4da67e77ec791522 Author: Richard Biener Date:

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2023-01-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 Richard Biener changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2023-01-06 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #17 from Martin Liška --- Oh, I didn't notice it's P1 :) Then sure, send it for this release.

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2023-01-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 Jakub Jelinek changed: What|Removed |Added Priority|P3 |P1 --- Comment #16 from Jakub Jelinek

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-23 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #15 from Martin Liška --- @Richi: Please send the patch for switch conversion in the next stage 1.

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-21 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 Richard Biener changed: What|Removed |Added CC||rguenth at gcc dot gnu.org --- Comment

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-05 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #13 from Martin Liška --- > As a hack I've removed them manually: > FOR_EACH_BB_FN (bb, cfun) > { > gimple_stmt_iterator gsi = gsi_after_labels (bb); > if (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) == GIMPLE_PREDICT) > gsi_rem

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

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

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #11 from Jakub Jelinek --- (In reply to Martin Liška from comment #7) > However, the CFG is not collapsed and thus it fails due to: > > bool > bit_test_cluster::is_beneficial (unsigned count, unsigned uniq) > { > return (((uniq ==

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-02 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #10 from Richard Biener --- Looks like a general CFG optimization if we have N forwarders to a PHI with the same value then we can merge them to one (it's enough to have a single forwarder which we can use as the remaining one even).

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-02 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #9 from Jakub Jelinek --- Indeed, comparing that to int firewall3(const uint8_t *restrict data) { const uint16_t dst_port = *((const uint16_t *)data + 32); switch (dst_port) { case 15: return 1; case 23: return 1;

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-02 Thread socketpair at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #8 from Коренберг Марк --- Okay, but why switch-case is not handled using fast implementation using masks (when difference between smallest and biggest integer <=64 ? See the first function in my first message where it works as expe

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-02 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 Martin Liška changed: What|Removed |Added Assignee|marxin at gcc dot gnu.org |unassigned at gcc dot gnu.org

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-02 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #6 from Martin Liška --- > this code should not be treated as if-else-if-else-if. Why? It's an equivalent representation as all ifs have a return statement. One another equivalent representation is: switch (dst_port) {

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-02 Thread socketpair at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #5 from Коренберг Марк --- Not only -s problem. I think -O3 in gcc 12.2 will run faster than -O3 in gcc 13 (for this case). this code should not be treated as if-else-if-else-if. gcc 12 does its job right.

[Bug tree-optimization/107767] [13 Regression] switch to table conversion happening even though using btq is better

2022-12-02 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107767 --- Comment #4 from Martin Liška --- So the optimization is enabled after r13-1184-g57424087e82db140 where we newly convert if-else-if series to switch, that's later converted by switch conversion pass to the array lookup. Now the question is w