* [PATCH 2/8] vect: Remove duplicated check on reduction operand
@ 2024-06-16 7:22 Feng Xue OS
2024-06-19 12:35 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Feng Xue OS @ 2024-06-16 7:22 UTC (permalink / raw)
To: Richard Biener; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]
In vectorizable_reduction, one check on a reduction operand via index could be
contained by another one check via pointer, so remove the former.
Thanks,
Feng
---
gcc/
* tree-vect-loop.cc (vectorizable_reduction): Remove the duplicated
check.
---
gcc/tree-vect-loop.cc | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index d9a2ad69484..6e8b3639daf 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -7815,11 +7815,9 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
"use not simple.\n");
return false;
}
- if (i == STMT_VINFO_REDUC_IDX (stmt_info))
- continue;
- /* For an IFN_COND_OP we might hit the reduction definition operand
- twice (once as definition, once as else). */
+ /* Skip reduction operands, and for an IFN_COND_OP we might hit the
+ reduction operand twice (once as definition, once as else). */
if (op.ops[i] == op.ops[STMT_VINFO_REDUC_IDX (stmt_info)])
continue;
--
2.17.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-vect-Remove-duplicated-check-on-reduction-operand.patch --]
[-- Type: text/x-patch; name="0002-vect-Remove-duplicated-check-on-reduction-operand.patch", Size: 1295 bytes --]
From 5d2c22ad724856db12bf0ca568650f471447fa34 Mon Sep 17 00:00:00 2001
From: Feng Xue <fxue@os.amperecomputing.com>
Date: Sun, 16 Jun 2024 12:08:56 +0800
Subject: [PATCH 2/8] vect: Remove duplicated check on reduction operand
In vectorizable_reduction, one check on a reduction operand via index could be
contained by another one check via pointer, so remove the former.
2024-06-16 Feng Xue <fxue@os.amperecomputing.com>
gcc/
* tree-vect-loop.cc (vectorizable_reduction): Remove the duplicated
check.
---
gcc/tree-vect-loop.cc | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index d9a2ad69484..6e8b3639daf 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -7815,11 +7815,9 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
"use not simple.\n");
return false;
}
- if (i == STMT_VINFO_REDUC_IDX (stmt_info))
- continue;
- /* For an IFN_COND_OP we might hit the reduction definition operand
- twice (once as definition, once as else). */
+ /* Skip reduction operands, and for an IFN_COND_OP we might hit the
+ reduction operand twice (once as definition, once as else). */
if (op.ops[i] == op.ops[STMT_VINFO_REDUC_IDX (stmt_info)])
continue;
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2/8] vect: Remove duplicated check on reduction operand
2024-06-16 7:22 [PATCH 2/8] vect: Remove duplicated check on reduction operand Feng Xue OS
@ 2024-06-19 12:35 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2024-06-19 12:35 UTC (permalink / raw)
To: Feng Xue OS; +Cc: gcc-patches
On Sun, Jun 16, 2024 at 9:22 AM Feng Xue OS <fxue@os.amperecomputing.com> wrote:
>
> In vectorizable_reduction, one check on a reduction operand via index could be
> contained by another one check via pointer, so remove the former.
OK.
Thanks,
Richard.
> Thanks,
> Feng
>
> ---
> gcc/
> * tree-vect-loop.cc (vectorizable_reduction): Remove the duplicated
> check.
> ---
> gcc/tree-vect-loop.cc | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
> index d9a2ad69484..6e8b3639daf 100644
> --- a/gcc/tree-vect-loop.cc
> +++ b/gcc/tree-vect-loop.cc
> @@ -7815,11 +7815,9 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
> "use not simple.\n");
> return false;
> }
> - if (i == STMT_VINFO_REDUC_IDX (stmt_info))
> - continue;
>
> - /* For an IFN_COND_OP we might hit the reduction definition operand
> - twice (once as definition, once as else). */
> + /* Skip reduction operands, and for an IFN_COND_OP we might hit the
> + reduction operand twice (once as definition, once as else). */
> if (op.ops[i] == op.ops[STMT_VINFO_REDUC_IDX (stmt_info)])
> continue;
>
> --
> 2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-06-19 12:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-16 7:22 [PATCH 2/8] vect: Remove duplicated check on reduction operand Feng Xue OS
2024-06-19 12:35 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).