On Wed, May 23, 2012 at 11:48 AM, Pat Haugen <pthau...@linux.vnet.ibm.com> wrote: > The following patch fixes existing code that tried to prevent load-hit-store > (LHS) from being in the same dispatch group. The main problem was use of the > wrong dependency list in is_costly_group(), but I also added code to verify > the memory refs overlap and to emit group ending nops for those ISAs that > have them. > > Bootstrap/regtest on powerpc64-linux with no new regressions. Ok for trunk? > > -Pat > > > 2012-05-23 Pat Haugen <pthau...@us.ibm.com> > > * config/rs6000/rs6000.c (rs6000_option_override_internal): Change > rs6000_sched_costly_dep default to true_store_to_load_dep_costly. > (adjacent_mem_locations): Move some code to and call... > (get_memref_parts): ...new function. > (mem_locations_overlap): New function. > (rs6000_adjust_priority): Adjust calls to is_load_insn/is_store_insn. > (is_mem_ref): Rename to... > (find_mem_ref): ...this. Return MEM rtx. > (get_store_dest): Remove function. > (is_load_insn1, is_load_insn, is_store_insn1, is_store_insn): Add > new parameter and adjust calls. > (rs6000_is_costly_dependence): Update calls for extra arg. Make sure > mem refs overlap for true_store_to_load_dep_costly. > (rs6000_sched_reorder2): Update calls for extra arg. Adjust args > passed to adjacent_mem_locations. > (is_costly_group): Walk resolved dependency list. > (force_new_group): Emit group ending nop for Power6/Power7. > * config/rs6000/rs6000.md (UNSPEC_GRP_END_NOP): New enum value. > (group_ending_nop): New define_insn. > > gcc/testsuite: > * gcc.target/powerpc/lhs-1.c: New. > * gcc.target/powerpc/lhs-2.c: New. > * gcc.target/powerpc/lhs-3.c: New.
I thought there was common infrastructure for recursively walking an insn for use in the memref comparison code, but, as you mentioned privately, other parts of GCC implement it manually. +/* Determine is PAT refers to memory. If so, set MEM_REF to the MEM rtx + and return true. */ I assume you mean "... if PAT" not "is PAT". Okay with that typo fix. Thanks, David