Tweak BB analysis for dr_analyze_innermost
commit358f3a0662b79de06420e7aa96864b6e43a063d3
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jul 2017 07:26:21 +0000 (3 07:26 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Jul 2017 07:26:21 +0000 (3 07:26 +0000)
tree19ef8dff4a03330cb84a3a52d8b86063fe8f40a1
parent8f8d5aac298d230495aac84ce540a2658d773508
Tweak BB analysis for dr_analyze_innermost

dr_analyze_innermost had a "struct loop *nest" parameter that acted
like a boolean.  This was added in r179161, with the idea that a
null nest selected BB-level analysis rather than loop analysis.

The handling seemed strange though.  If the DR was part of a loop,
we still tried to express the base and offset values as IVs, potentially
giving a nonzero step.  If that failed for any reason, we'd revert to
using the original base and offset, just as we would if we hadn't asked
for an IV in the first place.

It seems more natural to use the !in_loop handling whenever nest is null
and always set the step to zero.  This actually enables one more SLP
opportunity in bb-slp-pr65935.c.

I checked out r179161 and tried the patch there.  The test case added
in that revision still passes, so I don't think there was any particular
need to check simple_iv.

2017-06-28  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* tree-data-ref.c (dr_analyze_innermost): Replace the "nest"
parameter with a "loop" parameter and use it instead of the
loop containing DR_STMT.  Don't check simple_iv when doing
BB analysis.  Describe the two analysis modes in the comment.

gcc/testsuite/
* gcc.dg/vect/bb-slp-pr65935.c: Expect SLP to be used in main
as well.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249896 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/bb-slp-pr65935.c
gcc/tree-data-ref.c