array reference grouping: try grouping reads that overlap at tile depth
When checking whether two shared memory tiles can be combined to a single
smaller shared memory tile, the original code would only consider
pairs of tiles that have overlapping accesses at the innermost level.
It should be useful to also consider pairs of tiles that have overlapping
accesses at the level where they are currently being introduced.
The same test is also used for checking for overlapping writes,
so this function can now be reused.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>