From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E86461382C5 for ; Thu, 4 Mar 2021 11:02:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3862EE0880; Thu, 4 Mar 2021 11:02:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0F2E7E0880 for ; Thu, 4 Mar 2021 11:02:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D2FB6340F28 for ; Thu, 4 Mar 2021 11:02:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3BBA3567 for ; Thu, 4 Mar 2021 11:02:27 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1614855544.42fd29a7f1f28a6599ccd2089da1e1526b91e780.slyfox@gentoo> Subject: [gentoo-commits] proj/gcc-patches:master commit in: 9.3.0/gentoo/ X-VCS-Repository: proj/gcc-patches X-VCS-Files: 9.3.0/gentoo/33_all_vmat-PR97236.patch 9.3.0/gentoo/README.history X-VCS-Directories: 9.3.0/gentoo/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: 42fd29a7f1f28a6599ccd2089da1e1526b91e780 X-VCS-Branch: master Date: Thu, 4 Mar 2021 11:02:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e46b4b67-7b6e-4b62-8174-d880f9af597d X-Archives-Hash: 9ca9a750a035471beddca3f91b2a0874 commit: 42fd29a7f1f28a6599ccd2089da1e1526b91e780 Author: Sergei Trofimovich gentoo org> AuthorDate: Thu Mar 4 10:59:04 2021 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Thu Mar 4 10:59:04 2021 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=42fd29a7 9.3.0: backport PR97236: fix bad use of VMAT_CONTIGUOUS Bug: https://gcc.gnu.org/PR97236 Signed-off-by: Sergei Trofimovich gentoo.org> 9.3.0/gentoo/33_all_vmat-PR97236.patch | 118 +++++++++++++++++++++++++++++++++ 9.3.0/gentoo/README.history | 3 + 2 files changed, 121 insertions(+) diff --git a/9.3.0/gentoo/33_all_vmat-PR97236.patch b/9.3.0/gentoo/33_all_vmat-PR97236.patch new file mode 100644 index 0000000..ca7df78 --- /dev/null +++ b/9.3.0/gentoo/33_all_vmat-PR97236.patch @@ -0,0 +1,118 @@ +https://gcc.gnu.org/PR97236 + +From 97b668f9a8c6ec565c278a60e7d1492a6932e409 Mon Sep 17 00:00:00 2001 +From: Matthias Klose +Date: Tue, 6 Oct 2020 13:41:37 +0200 +Subject: [PATCH] Backport fix for PR/tree-optimization/97236 - fix bad use of + VMAT_CONTIGUOUS + +This avoids using VMAT_CONTIGUOUS with single-element interleaving +when using V1mode vectors. Instead keep VMAT_ELEMENTWISE but +continue to avoid load-lanes and gathers. + +2020-10-01 Richard Biener + + PR tree-optimization/97236 + * tree-vect-stmts.c (get_group_load_store_type): Keep + VMAT_ELEMENTWISE for single-element vectors. + + * gcc.dg/vect/pr97236.c: New testcase. + +(cherry picked from commit 1ab88985631dd2c5a5e3b5c0dce47cf8b6ed2f82) +--- + gcc/testsuite/gcc.dg/vect/pr97236.c | 43 +++++++++++++++++++++++++++++ + gcc/tree-vect-stmts.c | 20 ++++++-------- + 2 files changed, 52 insertions(+), 11 deletions(-) + create mode 100644 gcc/testsuite/gcc.dg/vect/pr97236.c + +diff --git a/gcc/testsuite/gcc.dg/vect/pr97236.c b/gcc/testsuite/gcc.dg/vect/pr97236.c +new file mode 100644 +index 00000000000..9d3dc20d953 +--- /dev/null ++++ b/gcc/testsuite/gcc.dg/vect/pr97236.c +@@ -0,0 +1,43 @@ ++typedef unsigned char __uint8_t; ++typedef __uint8_t uint8_t; ++typedef struct plane_t { ++ uint8_t *p_pixels; ++ int i_lines; ++ int i_pitch; ++} plane_t; ++ ++typedef struct { ++ plane_t p[5]; ++} picture_t; ++ ++#define N 4 ++ ++void __attribute__((noipa)) ++picture_Clone(picture_t *picture, picture_t *res) ++{ ++ for (int i = 0; i < N; i++) { ++ res->p[i].p_pixels = picture->p[i].p_pixels; ++ res->p[i].i_lines = picture->p[i].i_lines; ++ res->p[i].i_pitch = picture->p[i].i_pitch; ++ } ++} ++ ++int ++main() ++{ ++ picture_t aaa, bbb; ++ uint8_t pixels[10] = {1, 1, 1, 1, 1, 1, 1, 1}; ++ ++ for (unsigned i = 0; i < N; i++) ++ aaa.p[i].p_pixels = pixels; ++ ++ picture_Clone (&aaa, &bbb); ++ ++ uint8_t c = 0; ++ for (unsigned i = 0; i < N; i++) ++ c += bbb.p[i].p_pixels[0]; ++ ++ if (c != N) ++ __builtin_abort (); ++ return 0; ++} +diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c +index 507f81b0a0e..ffbba3441de 100644 +--- a/gcc/tree-vect-stmts.c ++++ b/gcc/tree-vect-stmts.c +@@ -2355,25 +2355,23 @@ get_group_load_store_type (stmt_vec_info stmt_info, tree vectype, bool slp, + /* First cope with the degenerate case of a single-element + vector. */ + if (known_eq (TYPE_VECTOR_SUBPARTS (vectype), 1U)) +- *memory_access_type = VMAT_CONTIGUOUS; ++ ; + + /* Otherwise try using LOAD/STORE_LANES. */ +- if (*memory_access_type == VMAT_ELEMENTWISE +- && (vls_type == VLS_LOAD +- ? vect_load_lanes_supported (vectype, group_size, masked_p) +- : vect_store_lanes_supported (vectype, group_size, +- masked_p))) ++ else if (vls_type == VLS_LOAD ++ ? vect_load_lanes_supported (vectype, group_size, masked_p) ++ : vect_store_lanes_supported (vectype, group_size, ++ masked_p)) + { + *memory_access_type = VMAT_LOAD_STORE_LANES; + overrun_p = would_overrun_p; + } + + /* If that fails, try using permuting loads. */ +- if (*memory_access_type == VMAT_ELEMENTWISE +- && (vls_type == VLS_LOAD +- ? vect_grouped_load_supported (vectype, single_element_p, +- group_size) +- : vect_grouped_store_supported (vectype, group_size))) ++ else if (vls_type == VLS_LOAD ++ ? vect_grouped_load_supported (vectype, single_element_p, ++ group_size) ++ : vect_grouped_store_supported (vectype, group_size)) + { + *memory_access_type = VMAT_CONTIGUOUS_PERMUTE; + overrun_p = would_overrun_p; +-- +2.30.1 + diff --git a/9.3.0/gentoo/README.history b/9.3.0/gentoo/README.history index e00e2e2..a9fffed 100644 --- a/9.3.0/gentoo/README.history +++ b/9.3.0/gentoo/README.history @@ -1,3 +1,6 @@ +5 TODO + + 33_all_vmat-PR97236.patch + 4 04 Nov 2020 + 30_all_plugin-objdump.patch U 11_all_extra-options.patch