This is the mail archive of the
mailing list for the GCC project.
Re: Better info for combine results in worse code generated
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 1 Jun 2015 08:39:05 -0500
- Subject: Re: Better info for combine results in worse code generated
- Authentication-results: sourceware.org; auth=none
- References: <20150528143941 dot GL14752 at bubble dot grove dot modra dot org> <20150528194222 dot GA12574 at gate dot crashing dot org> <20150529031120 dot GN14752 at bubble dot grove dot modra dot org> <20150529125838 dot GA17397 at gate dot crashing dot org> <20150529135008 dot GO14752 at bubble dot grove dot modra dot org> <20150529150004 dot GA31466 at gate dot crashing dot org> <20150530011727 dot GR14752 at bubble dot grove dot modra dot org> <20150530130220 dot GA22014 at gate dot crashing dot org> <20150601020318 dot GS14752 at bubble dot grove dot modra dot org>
On Mon, Jun 01, 2015 at 11:33:18AM +0930, Alan Modra wrote:
> Unifying andsi_mask with anddi_mask, and the fact that constraints for
> const_int see VOIDmode rather than the operand mode is why we get
> rldicr rather than rlwinm. Easily fixed by separating the si/di
> patterns, and with a little more work I may even be able to keep them
Maybe just swapping T to be before S will do what you want, already?
> In and<mode>3 expander I think you want the following since
> and64_2_operand covers the extra double-rotate cases, not all DImode.
> - if ((<MODE>mode == DImode && !and64_2_operand (operands, <MODE>mode))
> - || (<MODE>mode != DImode && !and_operand (operands, <MODE>mode)))
> + if (!and_operand (operands, <MODE>mode)
> + && (<MODE>mode != DImode || !and64_2_operand (operands, <MODE>mode)))
and64_2_operand includes all of and_operand. I agree it is a mess.
> In and<mode>3_imm_mask_dot and and<mode>3_imm_mask_dot2. Typo?
> - && any_mask_operand (operands, <MODE>mode)"
> + && !any_mask_operand (operands, <MODE>mode)"
Thinko; that whole line should just be removed. We prefer e.g. "rlwinm"
over "andi.", but "andi." over "rlwinm.". I'll do a patch.
> Seems to
> me we should omit !logical_const_operand from those insn predicates.
I tried to have no patterns overlap (where it matters at all); this helps
preserve your sanity if you try to move patterns around in the .md files
(first match wins).
> > I don't think it is a good idea to optimise code based on assumptions
> > of what SImode SETs will do to the dest seen as DImode, without making
> > those assumptions explicit in the RTL.
> I agree.
Ah, good to hear.
> Do you intend to
I don't have firm, short-term plans to remove ancient design, no.
> get rid of WORD_REGISTER_OPERATIONS,
rs6000 should not define it. What e.g. does it mean for mullw? Or,
worse, mulhw? Pretty much anything with "w" in its name is problematic.
[ What does this macro mean for rotates or right shifts at all? The docs
don't say. ]
Not related to this.
I would love to see this disappear. But, not related, for rs6000
Not sure about this one.
> and LOAD_EXTEND_OP? ;-)
With this macro you can just "opt out" for the hard cases.
In any case: I am working on a patch that unifies all rotate-and-mask
patterns, fixes the rtx_cost for those, and gets rid of 2rld completely.
If you really want to disallow most SImode ANDs, it won't be hard to
add that, much easier than with the current code.