cris: Use addi.b for additions where flags aren't inspected
authorHans-Peter Nilsson <hp@axis.com>
Wed, 8 Jul 2020 21:59:12 +0000 (23:59 +0200)
committerHans-Peter Nilsson <hp@axis.com>
Mon, 13 Jul 2020 08:13:51 +0000 (10:13 +0200)
commitef07c7a5884c130b48e653993bfaaf1ae9e6dedd
tree7aa26fea4bf67d3917544a495b50d888357bcd90
parentf4ac1a7fee8235c3be7660089b0654e6f05e36bb
cris: Use addi.b for additions where flags aren't inspected

Comparing to the cc0 version of the CRIS port, I ran a few
microbenchmarks, for example gcc.c-torture/execute/arith-rand.c,
where there's sometimes an addition between an operation of
interest and the test on the result.

Unfortunately this patch doesn't remedy all the performance
regression for that program.  But, this patch by itself helps
and makes sense to commit separately: lots of addi.b in
previously empty delay-slots, with functions shortened by one or
a few insns, in libgcc.  I had an experience with the
reload-related caveat of % on constraints, which is "fixed"
documentationwise since long (soon 15 years ago;
be3914df4cc8/r105517).  I removed an even older related FIXME.

gcc:
PR target/93372
* config/cris/cris.md ("*add<mode>3_addi"): New splitter.
("*addi_b_<mode>"): New pattern.
("*addsi3<setnz>"): Remove stale %-related comment.

gcc/testsuite:
PR target/93372
* gcc.target/cris/pr93372-45.c: New test.
gcc/config/cris/cris.md
gcc/testsuite/gcc.target/cris/pr93372-45.c [new file with mode: 0644]