Hi! On Thu, Sep 01, 2022 at 11:24:07AM +0800, Jiufu Guo wrote: > 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 (between split1 and split2) could optimize the emitted instructions.
The splitters can be used earlier even. For example, often combine will use them. > And if splitting before RA, for these constant splitters, we may have more > freedom to create pseduo 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. Yes. If you split after reload you have to do all local optimisations (that would have been done in earlier passes) manually. And all more global ones (involving just one or two more insns already) are essentially impossible to do. Splitting after reload is necessary in some cases. For example, all the integer "dot" insns split to the base insn and an explicit compare, if for some reason RA did not get cr0 here. Importantly, this happens very seldomly: RA knows it is two insns instead of one, and it chooses accordingly. Also it *has* to be after reload, it directly depends on what RA chose to do. Splitting dependent on if a VSR or a GPR (pair) was used is a losing proposition. It usually costs much more than it can gain. > gcc/ChangeLog: > > * config/rs6000/rs6000.md (const splitter): Update predicate. * 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. You should mention the changed to *both* splitters. For nameless splitters it helps if you can describe it a bit. This is hard, yes :-/ Okay for trunk like that. Thanks! Segher