[ARC] Use TARGET_INSN_COST.
authorClaudiu Zissulescu <claziss@gmail.com>
Thu, 13 Feb 2020 10:32:05 +0000 (12:32 +0200)
committerClaudiu Zissulescu <claziss@gmail.com>
Thu, 13 Feb 2020 10:32:05 +0000 (12:32 +0200)
commite57764be555e4a6162ac2776a98d91f93307eccf
tree2a81d3623a529a1fb8a6500d1fe1bad1f7c16c88
parent8dca38c43c98cd02a961306d42f3e8cbc2269b5d
[ARC] Use TARGET_INSN_COST.

TARGET_INSN_COST gives us a better control over the instruction costs
than classical RTX_COSTS.  A simple cost scheme is in place for the
time being, when optimizing for size, the cost is given by the
instruction length. When optimizing for speed, the cost is 1 for any
recognized instruction, and 2 for any load/store instruction.  The
latter one can be overwritten by using cost attribute for an
instruction.  Due to this change, we need to update also a number of
instruction patterns with a new predicate to better reflect the costs.

gcc/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* config/arc/arc.c (arc_insn_cost): New function.
(TARGET_INSN_COST): Define.
* config/arc/arc.md (cost): New attribute.
(add_n): Use arc_nonmemory_operand.
(ashlsi3_insn): Likewise, also update constraints.
(ashrsi3_insn): Likewise.
(rotrsi3): Likewise.
(add_shift): Likewise.
* config/arc/predicates.md (arc_nonmemory_operand): New predicate.

testsuite/
xxxx-xx-xx  Claudiu Zissulescu  <claziss@synopsys.com>

* gcc.target/arc/or-cnst-size2.c: Update test.
gcc/ChangeLog
gcc/config/arc/arc.c
gcc/config/arc/arc.md
gcc/config/arc/predicates.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arc/or-cnst-size2.c