[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-02-27 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 Alexandre Oliva changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|---

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-02-27 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #24 from Alexandre Oliva --- Author: aoliva Date: Wed Feb 28 05:25:34 2018 New Revision: 258053 URL: https://gcc.gnu.org/viewcvs?rev=258053=gcc=rev Log: [PR81611] turn inc-and-use-of-dead-orig into auto-inc When the addressing

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-02-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #23 from Jeffrey A. Law --- No, the DOM change is only a partial fix. I've largely approved the auto-inc change. I recommend the additional tests in c#19 be pulled into a distinct BZ and the gcc8 regression marker removed once the

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-02-15 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 Eric Gallager changed: What|Removed |Added CC||egallager at gcc dot gnu.org ---

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-30 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #21 from Alexandre Oliva --- Author: aoliva Date: Tue Jan 30 17:40:50 2018 New Revision: 257194 URL: https://gcc.gnu.org/viewcvs?rev=257194=gcc=rev Log: [PR81611] accept copies in simple_iv_increment_p If there are copies between

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-25 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #20 from Georg-Johann Lay --- A bit of the bloat reported in PR81625 is also due to missed post-inc addressing, so it might be worth a look if you are after more test cases. (Current 8.0.1 perfomrs better than 8.0.0 I used back then:

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-25 Thread gjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #19 from Georg-Johann Lay --- Hi, thanks for all that work and efforts. I tried that patch for the following small test: extern void foo (void); extern char volatile vv; void func2 (const int *p) { while (1) { int

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-23 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #18 from Alexandre Oliva --- Vacations over, patches formatted and posted. https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01994.html

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-03 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #17 from Alexandre Oliva --- Created attachment 43025 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43025=edit another complement to the initial partial patch, this one improving auto-inc-dec We already had code to turn the

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-03 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #16 from Alexandre Oliva --- Even if create_mem_ref_raw created a MEM_REF, we'd still allocate a new pseudo for the reg - 1 at cfgexpand, and that ends up preventing the post_inc addressing mode from being selected. The more I think

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-03 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #15 from Alexandre Oliva --- As we create_mem_ref within ivopts, create_mem_ref_raw requires a valid_mem_ref_p, which in memory_address_addr_space_p calls targetm.addr_space.legitimate_address_p, and that's

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-03 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #14 from Jeffrey A. Law --- MEM_REF (as opposed to TARGET_MEM_REF) should be able to handle any simple SSA_NAME + CONSTANT_OFFSET which are all we're really concerned with here. THe target's addressing modes don't really enter the

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-02 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #13 from Alexandre Oliva --- We do have such constant propagation on such ports as x86* and arm, but not on avr. Presumably (I haven't checked) it has to do with available addressing modes, and gimple's avoiding, even in MEM_REFs,

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2018-01-02 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #12 from Jeffrey A. Law --- You know, I wonder if we're missing something bigger here. ISTM we're potentially missing CSEs in memory addresses as well as forward propagation opportunities in MEM_REF expressions. I strongly suspect

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2017-12-27 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #11 from Alexandre Oliva --- Testing has revealed that the alternative complementary candidate patch introduces a number of regressions, in tests intended specifically to detect this kind of problem. I don't see an easy way to delay

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2017-12-26 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 Alexandre Oliva changed: What|Removed |Added Attachment #42971|0 |1 is obsolete|

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2017-12-26 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 Alexandre Oliva changed: What|Removed |Added Attachment #42969|0 |1 is obsolete|

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2017-12-26 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #8 from Alexandre Oliva --- Created attachment 42970 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42970=edit alternative (?) complementary candidate patch This addresses the concern of post-increment in non-loops. It solves

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2017-12-26 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #7 from Alexandre Oliva --- Hmm, what the complementary patch won't do is improve the odds of auto_inc or even saving a temp in spaghetti code, rather than in loops. Maybe that's important too? I wonder if we should add the

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2017-12-26 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #6 from Alexandre Oliva --- Created attachment 42969 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42969=edit complementary candidate patch This patch complements the earlier one. On AVR, unlike other ports, we had the

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2017-12-26 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 --- Comment #5 from Alexandre Oliva --- Created attachment 42968 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42968=edit partial candidate patch Alas, although it restores good code for x86_64 and arm, it doesn't go as far as enabling

[Bug tree-optimization/81611] [8 Regression] gcc un-learned loop / post-increment optimization

2017-12-26 Thread aoliva at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81611 Alexandre Oliva changed: What|Removed |Added Status|NEW |ASSIGNED