On 06/14/2016 09:54 AM, Kyrill Tkachov wrote:
Hi all,
The noce_convert_multiple_sets transformation in ifcvt is supposed to
handle things like:
if (x > y)
{ i = a; j = b; }
transforming them into conditional moves.
However it currently is rather conservative in that it allows only
simple reg-to-reg moves.
In the testcase in this patch the two inner moves actually contain a
simple sugreg like so:
(insn 51 68 52 6 (set (reg/v:SI 118 [ posD.2788 ])
(subreg:SI (reg:DI 125 [ ivtmp.4D.2805 ]) 0)) x.c:12 49
{*movsi_aarch64}
(expr_list:REG_DEAD (reg/v:SI 122 [ iD.2789 ])
(nil)))
(insn 52 51 69 6 (set (reg/v:SI 116 [ mincostD.2787 ])
(reg/v:SI 119 [ minD.2786 ])) x.c:12 49 {*movsi_aarch64}
(expr_list:REG_DEAD (reg/v:SI 119 [ minD.2786 ])
(nil)))
noce_convert_multiple_sets can handle these just fine when emitting the
conditional moves.
The gating function bb_ok_for_noce_multiple_sets just needs to allow it
through.
This patch does that by relaxing the check a bit to allow simple
register subregs.
Note that noce_convert_multiple_sets calls recog on the result of the
conditional move generation
and bails out if something has gone wrong, so this shouldn't result in
any unrecognisable instructions
being emitted.
With this patch I see 3 more cases being if-converted in SPECINT 2006
with no regression in the overall score
(or any individual sub-benchmarks).
Bootstrapped and tested on arm, aarch64 and x86_64.
Ok for trunk?
Thanks,
Kyrill
2016-06-14 Kyrylo Tkachov <kyrylo.tkac...@arm.com>
* ifcvt.c (bb_ok_for_noce_multiple_sets): Allow simple lowpart
register subregs in SET_SRC.
2016-06-14 Kyrylo Tkachov <kyrylo.tkac...@arm.com>
* gcc.target/aarch64/ifcvt_multiple_sets_subreg_1.c: New test.
OK.
jeff