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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2113915808B for ; Tue, 13 Feb 2024 11:17:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4FB74E29FF; Tue, 13 Feb 2024 11:17:23 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 396FAE29FF for ; Tue, 13 Feb 2024 11:17:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 639A8343006 for ; Tue, 13 Feb 2024 11:17:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CE43014C9 for ; Tue, 13 Feb 2024 11:17:20 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1707823036.568b3f9940f87a775060aea789b2f438af477e9f.sam@gentoo> Subject: [gentoo-commits] proj/gcc-patches:master commit in: 14.0.0/gentoo/ X-VCS-Repository: proj/gcc-patches X-VCS-Files: 14.0.0/gentoo/75_all_PR113734_middle_end_update_vector_loop_bounds.patch X-VCS-Directories: 14.0.0/gentoo/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 568b3f9940f87a775060aea789b2f438af477e9f X-VCS-Branch: master Date: Tue, 13 Feb 2024 11:17:20 +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: 1fe05e64-0995-455f-b82a-0589311b6239 X-Archives-Hash: 29fe50c609303b7fa7564b75bded5dbb commit: 568b3f9940f87a775060aea789b2f438af477e9f Author: Sam James gentoo org> AuthorDate: Tue Feb 13 11:17:16 2024 +0000 Commit: Sam James gentoo org> CommitDate: Tue Feb 13 11:17:16 2024 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=568b3f99 14.0.0: drop upstream patch Signed-off-by: Sam James gentoo.org> ...3734_middle_end_update_vector_loop_bounds.patch | 93 ---------------------- 1 file changed, 93 deletions(-) diff --git a/14.0.0/gentoo/75_all_PR113734_middle_end_update_vector_loop_bounds.patch b/14.0.0/gentoo/75_all_PR113734_middle_end_update_vector_loop_bounds.patch deleted file mode 100644 index dcc52df..0000000 --- a/14.0.0/gentoo/75_all_PR113734_middle_end_update_vector_loop_bounds.patch +++ /dev/null @@ -1,93 +0,0 @@ -https://gcc.gnu.org/PR113734 - -From 491e57451df47cda88f658601a92d6d006ae09d7 Mon Sep 17 00:00:00 2001 -From: Tamar Christina -Date: Tue, 13 Feb 2024 11:04:38 +0000 -Subject: [PATCH] middle-end: update vector loop upper bounds when early break - vect [PR113734] - -When doing early break vectorization we should treat the final iteration as -possibly being partial. This so that when we calculate the vector loop upper -bounds we take into account that final iteration could have done some work. - -The attached testcase shows that if we don't then cunroll may unroll the loop an -if the upper bound is wrong we lose a vector iteration. - -This is similar to how we adjust the scalar loop bounds for the PEELED case. - -gcc/ChangeLog: - - PR tree-optimization/113734 - * tree-vect-loop.cc (vect_transform_loop): Treat the final iteration of - an early break loop as partial. - -gcc/testsuite/ChangeLog: - - PR tree-optimization/113734 - * gcc.dg/vect/vect-early-break_117-pr113734.c: New test. ---- - .../vect/vect-early-break_117-pr113734.c | 37 +++++++++++++++++++ - gcc/tree-vect-loop.cc | 3 +- - 2 files changed, 39 insertions(+), 1 deletion(-) - create mode 100644 gcc/testsuite/gcc.dg/vect/vect-early-break_117-pr113734.c - -diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_117-pr113734.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_117-pr113734.c -new file mode 100644 -index 000000000000..36ae09483dfd ---- /dev/null -+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_117-pr113734.c -@@ -0,0 +1,37 @@ -+/* { dg-add-options vect_early_break } */ -+/* { dg-require-effective-target vect_early_break_hw } */ -+/* { dg-require-effective-target vect_int } */ -+/* { dg-additional-options "-O3" } */ -+ -+/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ -+ -+#include "tree-vect.h" -+ -+#define N 306 -+#define NEEDLE 136 -+ -+int table[N]; -+ -+__attribute__ ((noipa)) -+int foo (int i, unsigned short parse_tables_n) -+{ -+ parse_tables_n >>= 9; -+ parse_tables_n += 11; -+ while (i < N && parse_tables_n--) -+ table[i++] = 0; -+ -+ return table[NEEDLE]; -+} -+ -+int main () -+{ -+ check_vect (); -+ -+ for (int j = 0; j < N; j++) -+ table[j] = -1; -+ -+ if (foo (0, 0xFFFF) != 0) -+ __builtin_abort (); -+ -+ return 0; -+} -diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc -index 04f4b5b6b2fa..367077965fd9 100644 ---- a/gcc/tree-vect-loop.cc -+++ b/gcc/tree-vect-loop.cc -@@ -12174,7 +12174,8 @@ vect_transform_loop (loop_vec_info loop_vinfo, gimple *loop_vectorized_call) - /* True if the final iteration might not handle a full vector's - worth of scalar iterations. */ - bool final_iter_may_be_partial -- = LOOP_VINFO_USING_PARTIAL_VECTORS_P (loop_vinfo); -+ = LOOP_VINFO_USING_PARTIAL_VECTORS_P (loop_vinfo) -+ || LOOP_VINFO_EARLY_BREAKS (loop_vinfo); - /* The minimum number of iterations performed by the epilogue. This - is 1 when peeling for gaps because we always need a final scalar - iteration. */ --- -2.43.1 -