This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] ARM: Don't clobber CC reg when it is live after the peephole window
- From: Meador Inge <meadori at codesourcery dot com>
- To: Richard Earnshaw <rearnsha at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Ramana Radhakrishnan <Ramana dot Radhakrishnan at arm dot com>
- Date: Tue, 18 Jun 2013 11:22:47 -0500
- Subject: Re: [PATCH] ARM: Don't clobber CC reg when it is live after the peephole window
- References: <1369847707-8357-1-git-send-email-meadori at codesourcery dot com> <51B08A77 dot 7020700 at arm dot com> <51B0D3A3 dot 2020306 at codesourcery dot com>
Ping.
On 06/06/2013 01:23 PM, Meador Inge wrote:
> On 06/06/2013 08:11 AM, Richard Earnshaw wrote:
>
>> I understand (and agree with) this bit...
>>
>>> +(define_peephole2
>>> + [(set (reg:CC CC_REGNUM)
>>> + (compare:CC (match_operand:SI 0 "register_operand" "")
>>> + (match_operand:SI 1 "arm_rhs_operand" "")))
>>> + (cond_exec (ne (reg:CC CC_REGNUM) (const_int 0))
>>> + (set (match_operand:SI 2 "register_operand" "") (const_int 0)))
>>> + (cond_exec (eq (reg:CC CC_REGNUM) (const_int 0))
>>> + (set (match_dup 2) (const_int 1)))
>>> + (match_scratch:SI 3 "r")]
>>> + "TARGET_32BIT && !peep2_reg_dead_p (3, operands[0])"
>>> + [(set (match_dup 3) (minus:SI (match_dup 0) (match_dup 1)))
>>> + (parallel
>>> + [(set (reg:CC CC_REGNUM)
>>> + (compare:CC (const_int 0) (match_dup 3)))
>>> + (set (match_dup 2) (minus:SI (const_int 0) (match_dup 3)))])
>>> + (set (match_dup 2)
>>> + (plus:SI (plus:SI (match_dup 2) (match_dup 3))
>>> + (geu:SI (reg:CC CC_REGNUM) (const_int 0))))])
>>> +
>>
>> ... but what's this bit about?
>
> The original intent was to revert back to the original peephole pattern
> (pre-PR 46975) when the CC reg is still live, but that doesn't properly
> maintain the CC state either (it just happened to pass in the test
> case I was looking at because I only cared about the Z flag, which is
> maintained the same).
>
> OK with the above bit left out?
>
--
Meador Inge
CodeSourcery / Mentor Embedded