[Bug tree-optimization/101301] Improving sparse switch statement

2023-04-03 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 Martin Liška changed: What|Removed |Added Status|ASSIGNED|NEW Assignee|marxin at gcc dot

[Bug tree-optimization/101301] Improving sparse switch statement

2022-11-30 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 --- Comment #11 from CVS Commits --- The master branch has been updated by Martin Liska : https://gcc.gnu.org/g:4fa25a7eb322f0a003c1eb15680c71ece345e01e commit r13-4409-g4fa25a7eb322f0a003c1eb15680c71ece345e01e Author: Martin Liska Date: Mo

[Bug tree-optimization/101301] Improving sparse switch statement

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

[Bug tree-optimization/101301] Improving sparse switch statement

2021-07-06 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 --- Comment #9 from Segher Boessenkool --- (In reply to Thomas Koenig from comment #8) > (In reply to Segher Boessenkool from comment #7) > > > Yeah :-) Of course in your testing the nine named cases have the same > > probability, > > which i

[Bug tree-optimization/101301] Improving sparse switch statement

2021-07-06 Thread tkoenig at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 --- Comment #8 from Thomas Koenig --- (In reply to Segher Boessenkool from comment #7) > Yeah :-) Of course in your testing the nine named cases have the same > probability, > which is not very true in practice (but is there any better guess p

[Bug tree-optimization/101301] Improving sparse switch statement

2021-07-05 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 --- Comment #7 from Segher Boessenkool --- Assuming that you divide the "default" case into ten pieces of 0.01 each, some slight corrections: (In reply to Thomas Koenig from comment #6) > int foo3 (int n) > { > if (__builtin_expect_with_proba

[Bug tree-optimization/101301] Improving sparse switch statement

2021-07-04 Thread tkoenig at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 --- Comment #6 from Thomas Koenig --- If I create a foo3 function with int foo3 (int n) { if (__builtin_expect_with_probability (n >= 5, 1, 0.55)) { if (__builtin_expect_with_probability (n >= 7, 1, 0.33/0.55)) {

[Bug tree-optimization/101301] Improving sparse switch statement

2021-07-04 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 --- Comment #5 from Segher Boessenkool --- Looking at -fdump-tree-all-all, things are fine with "foo" until the switchlower pass. Before that all nine switch cases and the default case all had probability 0.10; after the switch conversion there

[Bug tree-optimization/101301] Improving sparse switch statement

2021-07-03 Thread tkoenig at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 --- Comment #4 from Thomas Koenig --- (In reply to Segher Boessenkool from comment #3) > What CPU is in your Power system, and what -mcpu= did you compile with? > What is the ABI you are using? (That last one doesn't seem to matter in > this pa

[Bug tree-optimization/101301] Improving sparse switch statement

2021-07-03 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 --- Comment #3 from Segher Boessenkool --- What CPU is in your Power system, and what -mcpu= did you compile with? What is the ABI you are using? (That last one doesn't seem to matter in this particular case, but :-) )

[Bug tree-optimization/101301] Improving sparse switch statement

2021-07-03 Thread tkoenig at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 Thomas Koenig changed: What|Removed |Added CC||segher at gcc dot gnu.org --- Comment #

[Bug tree-optimization/101301] Improving sparse switch statement

2021-07-03 Thread tkoenig at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101301 --- Comment #1 from Thomas Koenig --- Here's the assembly for the switch statement with -O3: cmpl$5, %edi je .L6 jle .L18 movl$8, %eax cmpl$8, %edi je .L1