[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-12 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 --- Comment #10 from Thomas Koenig --- Created attachment 44121 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44121&action=edit Test case for vectorizing, inc. assembly This test case, written by Nicolas König, shows a proof of concept fo

[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-12 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 --- Comment #9 from Thomas Koenig --- (In reply to Martin Liška from comment #8) > (In reply to Richard Biener from comment #7) > > Confirmed with a Haswell CPU as well. Without the __builtin_expect we > > rightfully predict the branch to be 50%

[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-11 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 --- Comment #8 from Martin Liška --- (In reply to Richard Biener from comment #7) > Confirmed with a Haswell CPU as well. Without the __builtin_expect we > rightfully predict the branch to be 50%/50% which means BB re-ordering will > do either n

[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-11 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 Richard Biener changed: What|Removed |Added Keywords||missed-optimization Target|

[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 --- Comment #6 from Andrew Pinski --- (In reply to Thomas Koenig from comment #5) > (In reply to Andrew Pinski from comment #1) > > These functions are not functional equivalent. > > > > In the b.c, it records the max location but it is the last

[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-10 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 --- Comment #5 from Thomas Koenig --- (In reply to Andrew Pinski from comment #1) > These functions are not functional equivalent. > > In the b.c, it records the max location but it is the last element which > contains that value. While in c.c,

[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 --- Comment #4 from Andrew Pinski --- (a a) != 0

[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-10 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 --- Comment #3 from Dominique d'Humieres --- > These functions are not functional equivalent. > > In the b.c, it records the max location but it is the last element which > contains that value. While in c.c, the first element which contains > th

[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 --- Comment #2 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > These functions are not functional equivalent. To get them equivalent, you either need to use >= or <=.

[Bug middle-end/85740] Non-optimal determining maximum in a loop

2018-05-10 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85740 --- Comment #1 from Andrew Pinski --- These functions are not functional equivalent. In the b.c, it records the max location but it is the last element which contains that value. While in c.c, the first element which contains the value is recor