From ec9069b7b7b07d5fda9c04aaa9b385fba89a6e16 Mon Sep 17 00:00:00 2001
From: Doug Gilmore <doug.gilmore@imgtec.com>
Date: Tue, 6 Sep 2016 10:18:42 -0700
Subject: [PATCH 2/2] Ensure points-to information is maintained for prefetch
addresses.
---
gcc/tree-ssa-loop-prefetch.c | 11 +++++++++++
1 file changed, 11 insertions(+)
@@ -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,16 @@ 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 (POINTER_TYPE_P (TREE_TYPE (addr_base)))
+ {
+ 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);
--
1.7.9.5