blob: 8540cd4aca03f8077c98480d442cc194836ea137 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
From 7b4cce4896cefefedba9545a9633585e086b7621 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=83=91=E6=99=A8=E5=8D=89?= <zhengchenhui1@huawei.com>
Date: Wed, 11 Sep 2024 18:26:22 +0800
Subject: [PATCH 1/2] Fix error with grouped_load merge in
slp-transpose-vectorize (for IALR8B)
---
gcc/tree-vect-slp.cc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index e3e246977..d4870de43 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -3807,7 +3807,11 @@ vect_slp_grouped_load_find (bb_vec_info bb_vinfo, vec<bool> &visited,
these two grouped loads need to be merged. */
tree opb = get_op_base_address (first_element);
unsigned int grp_size_b = DR_GROUP_SIZE (first_element);
- if (opa == opb && grp_size_a == grp_size_b)
+ /* Ensure that the elements merge to load group meet the alignment condition (dr_misalignment) */
+ HOST_WIDE_INT diff = 0;
+ diff = (TREE_INT_CST_LOW (DR_INIT (first_element->dr_aux.dr))
+ - TREE_INT_CST_LOW (DR_INIT (merge_first_element->dr_aux.dr)));
+ if (opa == opb && grp_size_a == grp_size_b && diff >= 0)
{
res.safe_push (first_element);
visited[i] = true;
--
2.33.0
|