This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Better info for combine results in worse code generated
- From: Alan Modra <amodra at gmail dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 1 Jun 2015 11:33:18 +0930
- 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>
On Sat, May 30, 2015 at 08:02:20AM -0500, Segher Boessenkool wrote:
> On Sat, May 30, 2015 at 10:47:27AM +0930, Alan Modra wrote:
> > Huh, that does look like you've destroyed my claim about SImode AND.
>
> Carefully worded :-)
Yes, I wrote it meaning as in refuted an argument, but it also fits
the culprit who broke the AND patterns. :-)
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
together.
There are some other problems too.
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[2], <MODE>mode))
- || (<MODE>mode != DImode && !and_operand (operands[2], <MODE>mode)))
+ if (!and_operand (operands[2], <MODE>mode)
+ && (<MODE>mode != DImode || !and64_2_operand (operands[2], <MODE>mode)))
In and<mode>3_imm_mask_dot and and<mode>3_imm_mask_dot2. Typo?
- && any_mask_operand (operands[2], <MODE>mode)"
+ && !any_mask_operand (operands[2], <MODE>mode)"
And that calls into question the !logical_const_operand in the insn
predicates for and<mode>3_mask_dot and and<mode>3_mask_dot2. Certain
masks satisfy both any_mask_operand and logical_const_operand.. After
fixing the typo, neither the andi./andis. patterns nor the
rlwinm./rldic[rl]. patterns will be enabled for those masks. Seems to
me we should omit !logical_const_operand from those insn predicates.
> 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. Do you intend to get rid of WORD_REGISTER_OPERATIONS,
POINTERS_EXTEND_UNSIGNED, PUSH_ROUNDING, SHORT_IMMEDIATES_SIGN_EXTEND,
and LOAD_EXTEND_OP? ;-)
--
Alan Modra
Australia Development Lab, IBM