]> git.ipfire.org Git - thirdparty/gcc.git/commit
Tweak BB analysis for dr_analyze_innermost
authorRichard Sandiford <richard.sandiford@linaro.org>
Mon, 3 Jul 2017 07:26:21 +0000 (07:26 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 3 Jul 2017 07:26:21 +0000 (07:26 +0000)
commitbc9f4235bcac6304141c472c94ecedeb9dbbff56
tree19ef8dff4a03330cb84a3a52d8b86063fe8f40a1
parentbe086ff50c79270411f14eec2d8f02c2b5bdb322
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.

From-SVN: r249896
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/bb-slp-pr65935.c
gcc/tree-data-ref.c