This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR tree-optimization/77550
- From: Richard Biener <rguenther at suse dot de>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 19 Sep 2016 11:25:15 +0200 (CEST)
- Subject: Re: [PATCH] Fix PR tree-optimization/77550
- Authentication-results: sourceware.org; auth=none
- References: <HE1PR0701MB21692BA9482AAB0FA503D50CE4F50@HE1PR0701MB2169.eurprd07.prod.outlook.com>
On Sun, 18 Sep 2016, Bernd Edlinger wrote:
> Hi,
>
> this PR shows that in vectorizable_store and vectorizable_load
> as well, the vector access always uses the first dr as the alias
> type for the whole access. But that is not right, if they are
> different types, like in this example.
>
> So I tried to replace all reference_alias_ptr_type (DR_REF (first_dr))
> by an alias type that is correct for all references in the whole
> access group. With this patch we fall back to ptr_type_node, which
> can alias anything, if the group consists of different alias sets.
>
>
> Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
> Is it OK for trunk and gcc-6-branch?
+/* Function get_group_alias_ptr_type.
+
+ Return the alias type for the group starting at FIRST_STMT
+ containing GROUP_SIZE elements. */
+
+static tree
+get_group_alias_ptr_type (gimple *first_stmt, int group_size)
+{
+ struct data_reference *first_dr, *next_dr;
+ gimple *next_stmt;
+ int i;
+
+ first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (first_stmt));
+ next_stmt = GROUP_NEXT_ELEMENT (vinfo_for_stmt (first_stmt));
+ for (i = 1; i < group_size && next_stmt; i++)
+ {
there is no need to pass in group_size, it's enough to walk
GROUP_NEXT_ELEMENT until it becomes NULL.
Ok with removing the redundant arg.
Thanks,
Richard.