From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 4CA4638515C9; Fri, 24 Mar 2023 22:33:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CA4638515C9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679697230; bh=KTCsQRRZ79K+E1yYWNKtcZqDibN0DocdyBK2XyLiXh8=; h=From:To:Subject:Date:From; b=OqO4i0zESMzm+d2yjNAhcIciRvQ40Q+C3iCPMIDWy4zG2Q35R19PeLWsUtMwJ+8t0 4XhCndm0Ga1WF2QHV9Mx/PlyiBvzxAAhu3x4+gTOPPlZYuBlsuIXMZYqTFAVCsOPnv zeSyoufrtG7Twk1jd6P2hZy5PJHbo5exAfTf7tYo= 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/work116-dmf)] Make load/cmp fusion know about prefixed loads. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work116-dmf X-Git-Oldrev: 6830791f561c41666f097e218e81b2af2435fff4 X-Git-Newrev: b362bc06c993a5cbc9d34ae185de88c15630fede Message-Id: <20230324223350.4CA4638515C9@sourceware.org> Date: Fri, 24 Mar 2023 22:33:50 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b362bc06c993a5cbc9d34ae185de88c15630fede commit b362bc06c993a5cbc9d34ae185de88c15630fede Author: Michael Meissner Date: Fri Mar 24 18:32:38 2023 -0400 Make load/cmp fusion know about prefixed loads. The issue with the bug is the power10 load GPR + cmpi -1/0/1 fusion optimization generates illegal assembler code. Ultimately the code was dying because the fusion load + compare -1/0/1 patterns did not handle the possibility that the load might be prefixed. The main cause is the constraints for the individual loads in the fusion did not match the machine. In particular, LWA is a ds format instruction when it is unprefixed. The code did not also set the prefixed attribute correctly. This patch rewrites the genfusion.pl script so that it will have more accurate constraints for the LWA and LD instructions (which are DS instructions). The updated genfusion.pl was then run to update fusion.md. Finally, the code for the "prefixed" attribute is modified so that it considers load + compare immediate patterns to be like the normal load insns in checking whether operand[1] is a prefixed instruction. I posted a version of patch on March 21st. This patch makes some code changes suggested in the genfusion.pl code. 2023-03-21 Michael Meissner gcc/ PR target/105325 * gcc/config/rs6000/genfusion.pl (gen_ld_cmpi_p10): Improve generation of the ld and lwa instructions which use the DS encoding instead of D. Use the YZ constraint for these loads. Handle prefixed loads better. Set the sign_extend attribute as appropriate. * gcc/config/rs6000/fusion.md: Regenerate. * gcc/config/rs6000/rs6000.md (prefixed attribute): Add fused_load_cmpi instructions to the list of instructions that might have a prefixed load instruction. gcc/testsuite/ PR target/105325 * g++.target/powerpc/pr105325.C: New test. * gcc.target/powerpc/fusion-p10-ldcmpi.c: Adjust insn counts. Diff: --- gcc/testsuite/g++.target/powerpc/pr105325.C | 0 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/gcc/testsuite/g++.target/powerpc/pr105325.C b/gcc/testsuite/g++.target/powerpc/pr105325.C new file mode 100644 index 00000000000..e69de29bb2d