tree-optimization/101293 - further enhance LIMs ref canonicalization
authorRichard Biener <rguenther@suse.de>
Fri, 2 Jul 2021 10:57:06 +0000 (12:57 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 2 Jul 2021 11:54:30 +0000 (13:54 +0200)
commit4546f423ecff96f223adfbec4963d2ff17f27c7b
tree8e730b452d7c751f146eb4dbe5c9fd8cc53a3e64
parentbc8f0ed7042280282035168428f6afc839997cf0
tree-optimization/101293 - further enhance LIMs ref canonicalization

This makes sure to handle MEM[p + 4] and MEM[p].j with j at offset 4
as the same ref in store motion.  For hashing we need to be
more restrictive in what we handle since there's no poly-int
handlers for inchash.  For comparison we can compare poly_offsets directly.

2021-07-02  Richard Biener  <rguenther@suse.de>

PR tree-optimization/101293
* tree-ssa-loop-im.c (mem_ref_hasher::equal): Compare MEM_REF bases
with combined offsets.
(gather_mem_refs_stmt): Hash MEM_REFs as if their offset were
combined with the rest of the offset.

* gcc.dg/tree-ssa/ssa-lim-15.c: New testcase.
gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-15.c [new file with mode: 0644]
gcc/tree-ssa-loop-im.c