]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000: allow constant splitter run in split1 pass
authorJiufu Guo <guojiufu@linux.ibm.com>
Thu, 8 Sep 2022 05:55:53 +0000 (13:55 +0800)
committerJiufu Guo <guojiufu@linux.ibm.com>
Thu, 8 Sep 2022 08:10:29 +0000 (16:10 +0800)
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.

gcc/config/rs6000/rs6000.md

index 959fad23091016273541c0fb6e8cb40a33863eb2..ad5a4cf2ef83329fb72963c330e6cc42deb13dcc 100644 (file)
 ; 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
 ;; 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)]