From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 3E346387086F; Thu, 6 Aug 2020 17:51:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E346387086F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596736290; bh=pPuIwTfljxNEaFe0Goq8yhndOr3YXoVaBmZx6cfSfVk=; h=From:To:Subject:Date:From; b=oxKJz/ifnG+cQM39MGeYdNu/8MH9GoHxJFxkLWLDEPMH0hUHlp4hn1oTJBQz2gEcC AahjQf0OOkCkrR+M9cMd1dqDyB1hEZA0CZM4yKwhqDqrnYcfEEUnb1FtPG/Xu3ug7H UfwUMS4DY5jSvTVMEF2AyzJMpzbR50mshcDBD/eY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work008-orig)] rs6000: Don't ICE when spilling an MMA accumulator X-Act-Checkin: gcc X-Git-Author: Peter Bergner X-Git-Refname: refs/users/meissner/heads/work008-orig X-Git-Oldrev: 165843ac435166ac4ad200f185e15ee2d46dc2bb X-Git-Newrev: 9c376d1c166e7c8b10bba6f1675d2471ffe8447f Message-Id: <20200806175130.3E346387086F@sourceware.org> Date: Thu, 6 Aug 2020 17:51:30 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2020 17:51:30 -0000 https://gcc.gnu.org/g:9c376d1c166e7c8b10bba6f1675d2471ffe8447f commit 9c376d1c166e7c8b10bba6f1675d2471ffe8447f Author: Peter Bergner Date: Thu Aug 6 10:03:03 2020 -0500 rs6000: Don't ICE when spilling an MMA accumulator When we spill an accumulator that has a known zero value, LRA will emit a new (set (reg:PXI ...) 0) insn, but it does not use the mma_xxsetaccz pattern to do it, leading to an unrecognized insn ICE. The solution here is to move the xxsetaccz instruction into the movpxi pattern and have the xxsetaccz pattern call the move pattern. 2020-08-06 Peter Bergner gcc/ PR target/96446 * config/rs6000/mma.md (*movpxi): Add xxsetaccz generation. Disable split for zero constant source operand. (mma_xxsetaccz): Change to define_expand. Call gen_movpxi. gcc/testsuite/ PR target/96446 * gcc.target/powerpc/pr96446.c: New test. Diff: --- gcc/config/rs6000/mma.md | 22 ++++++++++++++-------- gcc/testsuite/gcc.target/powerpc/pr96446.c | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/gcc/config/rs6000/mma.md b/gcc/config/rs6000/mma.md index 15cacfb7fc1..a3fd28bdd0a 100644 --- a/gcc/config/rs6000/mma.md +++ b/gcc/config/rs6000/mma.md @@ -328,11 +328,15 @@ [(set (match_operand:PXI 0 "nonimmediate_operand" "=d,m,d,d") (match_operand:PXI 1 "input_operand" "m,d,d,O"))] "TARGET_MMA - && ((gpc_reg_operand (operands[0], PXImode) - && !(CONST_INT_P (operands[1]) && INTVAL (operands[1]) == 0)) + && (gpc_reg_operand (operands[0], PXImode) || gpc_reg_operand (operands[1], PXImode))" - "#" - "&& reload_completed" + "@ + # + # + # + xxsetaccz %A0" + "&& reload_completed + && !(fpr_reg_operand (operands[0], PXImode) && operands[1] == const0_rtx)" [(const_int 0)] { rs6000_split_multireg_move (operands[0], operands[1]); @@ -409,12 +413,14 @@ " %A0" [(set_attr "type" "mma")]) -(define_insn "mma_xxsetaccz" - [(set (match_operand:PXI 0 "fpr_reg_operand" "=d") +(define_expand "mma_xxsetaccz" + [(set (match_operand:PXI 0 "fpr_reg_operand") (const_int 0))] "TARGET_MMA" - "xxsetaccz %A0" - [(set_attr "type" "mma")]) +{ + emit_insn (gen_movpxi (operands[0], const0_rtx)); + DONE; +}) (define_insn "mma_" [(set (match_operand:PXI 0 "fpr_reg_operand" "=&d") diff --git a/gcc/testsuite/gcc.target/powerpc/pr96446.c b/gcc/testsuite/gcc.target/powerpc/pr96446.c new file mode 100644 index 00000000000..2083bf4a76a --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr96446.c @@ -0,0 +1,16 @@ +/* PR target/96466 */ +/* { dg-do compile } */ +/* { dg-require-effective-target power10_ok } */ +/* { dg-options "-mdejagnu-cpu=power10 -O2" } */ + +/* Verify we do not ICE on the following. */ + +extern void bar0 (void); +void +foo0 (__vector_quad *dst) +{ + __vector_quad acc; + __builtin_mma_xxsetaccz (&acc); + bar0 (); + *dst = acc; +}