This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 4.8, i386]: Enable post-reload compare optimization pass (PR28685)
On Mon, Feb 6, 2012 at 9:59 PM, Richard Henderson <rth@redhat.com> wrote:
> On 02/05/2012 07:27 AM, Uros Bizjak wrote:
>> Hello!
>>
>> Attached patch enables post-reload compare optimization pass for x86 targets.
>
> Hmm. ?Well, the only thing that's going to work for x86 is the double-compare
> elimination portion.
>
> If we want to use this pass for x86, then for 4.8 we should also fix the
> discrepancy between the compare-elim canonical
>
> ?[(operate)
> ? (set-cc)]
>
> and the combine canonical
>
> ?[(set-cc)
> ? (operate)]
>
> (Because of the simplicity of the substitution in compare-elim, I prefer
> the former as the canonical canonical.)
You are probably referring to following testcase:
--cut here--
int test (int a, int b)
{
int lt = a + b < 0;
int eq = a + b == 0;
if (lt)
return 1;
return eq;
}
--cut here--
where combine creates:
Trying 8 -> 9:
Successfully matched this instruction:
(parallel [
(set (reg:CCZ 17 flags)
(compare:CCZ (plus:SI (reg/v:SI 63 [ a ])
(reg/v:SI 64 [ b ]))
(const_int 0 [0])))
(set (reg:SI 60 [ D.1710 ])
(plus:SI (reg/v:SI 63 [ a ])
(reg/v:SI 64 [ b ])))
])
Uros.