[SH] PR 51244 - Add combiner patterns for branch inversion

Oleg Endo oleg.endo@t-online.de
Sun Aug 12 12:48:00 GMT 2012


Hello,

This adds some patters that allow the combine pass to catch inverted
compare and branch opportunities better.

Tested on rev 190273 with
make -k check RUNTESTFLAGS="--target_board=sh-sim
\{-m2/-ml,-m2/-mb,-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"

and no new failures.
OK?

PS: I'm still puzzled why combine sometimes takes different 'routes' on
SH4A and/or SH2A which requires extra patterns to handle some cases ... 

Cheers,
Oleg

ChangeLog:

	PR target/51244
	* config/sh/sh.md: Add splits for inverted compare and branch 
	opportunities.
	(*cmpeqsi_t): New insn.
	(cmpgtsi_t, cmpgesi_t): Swap r and N alternatives.
	(cmpgeusi_t): Use satisfies_constraint_Z.  Emit sett insn in 
	replacement insn list and not in the preparation statements.
	(clrt, sett): Add mt_group attribute.

testsuite/ChangeLog:

	PR target/51244
	* gcc.target/sh/pr51244-7.c: New.
	* gcc.target/sh/pr51244-8.c: New.
	* gcc.target/sh/pr51244-9.c: New.
	* gcc.target/sh/pr51244-10.c: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sh_pr51244_10.patch
Type: text/x-patch
Size: 10264 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120812/be9e3f70/attachment.bin>


More information about the Gcc-patches mailing list