This is the mail archive of the
mailing list for the GCC project.
Re: Right way to represent flag-setting arithmetic instructions in MD files
- From: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 10 Mar 2017 10:30:33 +0000
- Subject: Re: Right way to represent flag-setting arithmetic instructions in MD files
- Authentication-results: sourceware.org; auth=none
- References: <58C27B9A.firstname.lastname@example.org> <4999274.kuIoDLHJu9@polaris>
<resending due to mailing list failure>
On 10/03/17 10:23, Eric Botcazou wrote:
My understanding was that the order of the two in this pattern here doesn't
matter because there is an implicit PARALLEL around them, but I found that
the compare-elimination pass (compare-elim.c) assumes that the COMPARE set
must be in the second position for it to do the transformations it wants.
Why do you want to use the compare-elimination pass exactly if the flags are
exposed before reload, as is the case on Aarch64 I think? The combiner is
supposed to do the same job instead for these targets.
I'm trying to improve the cases where the result of the arithmetic
operation is used in multiple places besides the comparison.
add w0, w0, w1
add w1, w0, 2
cmp w0, 0
Combine will not attempt to merge the first ADD and CMP because W0 is used
in the second ADD. The compare-elimination pass so far looks like a far simpler
place to implement this transformation than combine.