public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7229] amdgcn: Allow vector reductions on constants
@ 2022-02-14 14:12 Andrew Stubbs
  0 siblings, 0 replies; only message in thread
From: Andrew Stubbs @ 2022-02-14 14:12 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d51cad0b840a14c66732cb6a166c11ddf55d18b2

commit r12-7229-gd51cad0b840a14c66732cb6a166c11ddf55d18b2
Author: Andrew Stubbs <ams@codesourcery.com>
Date:   Sat Feb 12 23:44:48 2022 +0000

    amdgcn: Allow vector reductions on constants
    
    Obviously it would be better if these reductions could be evaluated at compile
    time, but this will avoid an ICE.
    
    gcc/ChangeLog:
    
            * config/gcn/gcn.cc (gcn_expand_reduc_scalar): Use force_reg.

Diff:
---
 gcc/config/gcn/gcn.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index 74819c6e4d7..402f0256411 100644
--- a/gcc/config/gcn/gcn.cc
+++ b/gcc/config/gcn/gcn.cc
@@ -4460,7 +4460,7 @@ gcn_expand_reduc_scalar (machine_mode mode, rtx src, int unspec)
      pair of lanes, then on every pair of results from the previous
      iteration (thereby effectively reducing every 4 lanes) and so on until
      all lanes are reduced.  */
-  rtx in, out = src;
+  rtx in, out = force_reg (mode, src);
   for (int i = 0, shift = 1; i < 6; i++, shift <<= 1)
     {
       rtx shift_val = gen_rtx_CONST_INT (VOIDmode, shift);


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

only message in thread, other threads:[~2022-02-14 14:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-14 14:12 [gcc r12-7229] amdgcn: Allow vector reductions on constants Andrew Stubbs

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