aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Gilmore <doug.gilmore@imgtec.com>2016-09-23 15:48:01 +0000
committerMatthew Fortune <mpf@gcc.gnu.org>2016-09-23 15:48:01 +0000
commited481942e3c90b596b22b5001010a87a505829d5 (patch)
tree41b7dc7c48c0ed95a1bd38260399aefda4978939
parent0af06385d3f521d4afc501b7ddc75d94120e17a1 (diff)
downloadgcc-ed481942e3c90b596b22b5001010a87a505829d5.zip
gcc-ed481942e3c90b596b22b5001010a87a505829d5.tar.gz
gcc-ed481942e3c90b596b22b5001010a87a505829d5.tar.bz2
Ensure points-to information is maintained for prefetch.
gcc/ PR tree-optimization/77654 * tree-ssa-alias.c (issue_prefetch_ref): Add call to duplicate_ssa_name_ptr_info. From-SVN: r240439
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-loop-prefetch.c12
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 14a5518..6262f03 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-23 Doug Gilmore <doug.gilmore@imgtec.com>
+
+ PR tree-optimization/77654
+ * tree-ssa-alias.c (issue_prefetch_ref): Add call
+ to duplicate_ssa_name_ptr_info.
+
2016-09-23 David Malcolm <dmalcolm@redhat.com>
PR preprocessor/77672
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 26cf0a0..056815d 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-loop-manip.h"
#include "tree-ssa-loop-niter.h"
#include "tree-ssa-loop.h"
+#include "ssa.h"
#include "tree-into-ssa.h"
#include "cfgloop.h"
#include "tree-scalar-evolution.h"
@@ -1160,6 +1161,17 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
addr = force_gimple_operand_gsi (&bsi, unshare_expr (addr), true,
NULL, true, GSI_SAME_STMT);
}
+
+ if (TREE_CODE (addr_base) == SSA_NAME
+ && TREE_CODE (addr) == SSA_NAME)
+ {
+ duplicate_ssa_name_ptr_info (addr, SSA_NAME_PTR_INFO (addr_base));
+ /* As this isn't a plain copy we have to reset alignment
+ information. */
+ if (SSA_NAME_PTR_INFO (addr))
+ mark_ptr_info_alignment_unknown (SSA_NAME_PTR_INFO (addr));
+ }
+
/* Create the prefetch instruction. */
prefetch = gimple_build_call (builtin_decl_explicit (BUILT_IN_PREFETCH),
3, addr, write_p, local);