Message ID | 20140814155008.GH1784@tucnak.redhat.com |
---|---|
State | New |
Headers | show |
On 08/14/2014 05:50 PM, Jakub Jelinek wrote: > I hope the scheduler doesn't attempt to swap sp += 24 with flags setter > because of the sp += 16 vs. flags setter dependency and sp += 24 vs. sp += > 16 dependency, but I feel kind of uneasy with find_inc assuming the recorded > dependency is the one for the mem_reg0, when in this case the dependency is > there for completely different register. Let me think about that for a while. Thanks for debugging the cache problem. Bernd
On Thu, Aug 14, 2014 at 05:59:56PM +0200, Bernd Schmidt wrote: > On 08/14/2014 05:50 PM, Jakub Jelinek wrote: > >I hope the scheduler doesn't attempt to swap sp += 24 with flags setter > >because of the sp += 16 vs. flags setter dependency and sp += 24 vs. sp += > >16 dependency, but I feel kind of uneasy with find_inc assuming the recorded > >dependency is the one for the mem_reg0, when in this case the dependency is > >there for completely different register. > > Let me think about that for a while. Thanks for debugging the cache problem. Did you have time to think about this? Would prefer not to have this unfixed for too long. Jakub
On 09/01/2014 11:03 AM, Jakub Jelinek wrote: > On Thu, Aug 14, 2014 at 05:59:56PM +0200, Bernd Schmidt wrote: >> On 08/14/2014 05:50 PM, Jakub Jelinek wrote: >>> I hope the scheduler doesn't attempt to swap sp += 24 with flags setter >>> because of the sp += 16 vs. flags setter dependency and sp += 24 vs. sp += >>> 16 dependency, but I feel kind of uneasy with find_inc assuming the recorded >>> dependency is the one for the mem_reg0, when in this case the dependency is >>> there for completely different register. >> >> Let me think about that for a while. Thanks for debugging the cache problem. > > Did you have time to think about this? Would prefer not to have this > unfixed for too long. Go ahead with your solution, I don't think I can really spare the time right now. Bernd
--- gcc/sched-deps.c.jj 2014-08-12 17:06:26.000000000 +0200 +++ gcc/sched-deps.c 2014-08-14 11:46:25.509631874 +0200 @@ -1233,6 +1233,13 @@ add_or_update_dep_1 (dep_t new_dep, bool switch (ask_dependency_caches (new_dep)) { case DEP_PRESENT: + dep_t present_dep; + sd_iterator_def sd_it; + + present_dep = sd_find_dep_between_no_cache (DEP_PRO (new_dep), + DEP_CON (new_dep), + resolved_p, &sd_it); + DEP_MULTIPLE (present_dep) = 1; return DEP_PRESENT; case DEP_CHANGED: @@ -4752,23 +4759,6 @@ find_inc (struct mem_inc_info *mii, bool goto next; } - /* The inc instruction could have clobbers, make sure those - registers are not used in mem insn. */ - FOR_EACH_INSN_DEF (def, mii->inc_insn) - if (!reg_overlap_mentioned_p (DF_REF_REG (def), mii->mem_reg0)) - { - df_ref use; - FOR_EACH_INSN_USE (use, mii->mem_insn) - if (reg_overlap_mentioned_p (DF_REF_REG (def), - DF_REF_REG (use))) - { - if (sched_verbose >= 5) - fprintf (sched_dump, - "inc clobber used in store failure.\n"); - goto next; - } - } - newaddr = mii->inc_input; if (mii->mem_index != NULL_RTX) newaddr = gen_rtx_PLUS (GET_MODE (newaddr), newaddr,