aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@codesourcery.com>2022-02-12 23:44:48 +0000
committerAndrew Stubbs <ams@codesourcery.com>2022-02-14 13:39:13 +0000
commitd51cad0b840a14c66732cb6a166c11ddf55d18b2 (patch)
treea32526d0c87e88706249336a16f4c92907aa343b
parent0a1a3afb5fb36e2d10ad92bf788e16d837451571 (diff)
downloadgcc-d51cad0b840a14c66732cb6a166c11ddf55d18b2.zip
gcc-d51cad0b840a14c66732cb6a166c11ddf55d18b2.tar.gz
gcc-d51cad0b840a14c66732cb6a166c11ddf55d18b2.tar.bz2
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.
-rw-r--r--gcc/config/gcn/gcn.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index 74819c6..402f025 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);