From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2066) id 821F53858D1E; Thu, 8 Sep 2022 08:11:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 821F53858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662624675; bh=HxA6cAnzR47HrwUvntKXMziSdLCGjdwo8++YtUTTwVY=; h=From:To:Subject:Date:From; b=qyDz+fqw+eIHsglpGckZI5P1wbzmWU5Vj61hDp0X3fexyot1wCFta7bDjMTl7OYiz oYExKJVXwjDy1PUCeKzoFj8vi4VDYG4kWHPK0jElT2q5NOCWecxQFoC7z5mlCsbEWS Vep35OwGyRL0DS+jKIwl6bg7rJVs6b5UQcE3RNCE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jiu Fu Guo To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2532] rs6000: allow constant splitter run in split1 pass X-Act-Checkin: gcc X-Git-Author: Jiufu Guo X-Git-Refname: refs/heads/master X-Git-Oldrev: 36ecfe1c1c6f93e6c496ad91fa1d0a35f72c6d15 X-Git-Newrev: fbb550359beb904f00f22b86b64a47313c0ae45a Message-Id: <20220908081115.821F53858D1E@sourceware.org> Date: Thu, 8 Sep 2022 08:11:15 +0000 (GMT) List-Id: https://gcc.gnu.org/g:fbb550359beb904f00f22b86b64a47313c0ae45a commit r13-2532-gfbb550359beb904f00f22b86b64a47313c0ae45a Author: Jiufu Guo Date: Thu Sep 8 13:55:53 2022 +0800 rs6000: allow constant splitter run in split1 pass Currently, these two splitters (touched in this patch) are using predicate `int_reg_operand_not_pseudo`, then they work in split2 pass after RA in most times, and can not run before RA. It would not be a bad idea to allow these splitters before RA. Then more passes (e.g. combine, sched...) could optimize the emitted instructions. And if splitting before RA, for current constant splitter, we may have more freedom to create pseduo to help to generate more parallel instructions. For the example in the leading patch [PATCH 1/2]: pli+plit+rldimi would be better than pli+sldi+paddi. Test this patch with spec, we could see performance gain some times; while the improvement is not stable and woud caused by the patch indirectly. gcc/ChangeLog: * config/rs6000/rs6000.md (splitter for set to and_mask constants): Use int_reg_operand (instead of int_reg_operand_not_pseudo). (splitter for multi-insn constant loads): Ditto. Diff: --- gcc/config/rs6000/rs6000.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 959fad23091..ad5a4cf2ef8 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -9683,7 +9683,7 @@ ; Some DImode loads are best done as a load of -1 followed by a mask ; instruction. (define_split - [(set (match_operand:DI 0 "int_reg_operand_not_pseudo") + [(set (match_operand:DI 0 "int_reg_operand") (match_operand:DI 1 "const_int_operand"))] "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1 @@ -9701,7 +9701,7 @@ ;; When non-easy constants can go in the TOC, this should use ;; easy_fp_constant predicate. (define_split - [(set (match_operand:DI 0 "int_reg_operand_not_pseudo") + [(set (match_operand:DI 0 "int_reg_operand") (match_operand:DI 1 "const_int_operand"))] "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1" [(pc)]