On January 4, 2016 8:08:17 PM GMT+01:00, Jeff Law <l...@redhat.com> wrote: >On 12/21/2015 06:13 AM, Alan Lawrence wrote: >> This is a respin of patches >> https://gcc.gnu.org/ml/gcc-patches/2015-10/msg03266.html and >> https://gcc.gnu.org/ml/gcc-patches/2015-10/msg03267.html, which were >> "too quickly" approved before concerns with efficiency were pointed >out. >> >> I tried to change the hashing just in tree-ssa-dom.c using C++ >subclassing, but >> couldn't cleanly separate this out from tree-ssa-scopedtables and >> tree-ssa-threadedge.c due to use of avail_exprs_stack. So I figured >it was >> probably appropriate to use the equivalences in jump threading too. >Also, >> using get_ref_base_and_extent unifies handling of MEM_REFs and >ARRAY_REFs
Without looking at the patch, ARRAY_REFs can have non-constant indices which get_ref_base_and_extend handles conservative. You should make sure to not regress here. Richard. >> (hence only one patch rather than two). >It is appropriate. > > >> I've added a couple of testcases that show the improvement in DOM, >but in all >> cases I had to disable FRE, even PRE, to get any improvement, apart >from on >> ssa-dom-cse-2.c itself (where on the affected platforms FRE still >does not do >> the optimization). This makes me wonder if this is the right approach >or whether >> changing the references output by SRA (as per >> https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01490.html , judged as >a hack to >> SRA to work around limitations in DOM - or is it?) would be better. >I just doubt it happens all that much. > > > >Jeff