public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-638] internal-fn: Do not force vcond_mask operands to reg.
@ 2024-05-17 20:46 Robin Dapp
  0 siblings, 0 replies; only message in thread
From: Robin Dapp @ 2024-05-17 20:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7ca35f2e430081d6ec91e910002f92d9713350fa

commit r15-638-g7ca35f2e430081d6ec91e910002f92d9713350fa
Author: Robin Dapp <rdapp@ventanamicro.com>
Date:   Fri May 10 12:44:44 2024 +0200

    internal-fn: Do not force vcond_mask operands to reg.
    
    In order to directly use constants this patch removes force_regs
    in the vcond_mask expander.
    
    gcc/ChangeLog:
    
            PR middle-end/113474
    
            * internal-fn.cc (expand_vec_cond_mask_optab_fn):  Remove
            force_regs.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/riscv/rvv/autovec/pr113474.c: New test.

Diff:
---
 gcc/internal-fn.cc                                    |  3 ---
 gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113474.c | 13 +++++++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc
index 73045ca8c8c1..9c09026793fa 100644
--- a/gcc/internal-fn.cc
+++ b/gcc/internal-fn.cc
@@ -3165,9 +3165,6 @@ expand_vec_cond_mask_optab_fn (internal_fn, gcall *stmt, convert_optab optab)
   rtx_op1 = expand_normal (op1);
   rtx_op2 = expand_normal (op2);
 
-  mask = force_reg (mask_mode, mask);
-  rtx_op1 = force_reg (mode, rtx_op1);
-
   rtx target = expand_expr (lhs, NULL_RTX, VOIDmode, EXPAND_WRITE);
   create_output_operand (&ops[0], target, mode);
   create_input_operand (&ops[1], rtx_op1, mode);
diff --git a/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113474.c b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113474.c
new file mode 100644
index 000000000000..0364bf9f5e38
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/rvv/autovec/pr113474.c
@@ -0,0 +1,13 @@
+/* { dg-do compile { target riscv_v } }  */
+/* { dg-additional-options "-std=c99" }  */
+
+void
+foo (int n, int **a)
+{
+  int b;
+  for (b = 0; b < n; b++)
+    for (long e = 8; e > 0; e--)
+      a[b][e] = a[b][e] == 15;
+}
+
+/* { dg-final { scan-assembler "vmerge.vim" } }  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-17 20:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-17 20:46 [gcc r15-638] internal-fn: Do not force vcond_mask operands to reg Robin Dapp

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).