arc: Avoid store/load pipeline hazard
authorAndrew Burgess <aburgess@gcc.gnu.org>
Wed, 30 Nov 2016 11:08:06 +0000 (11:08 +0000)
committerAndrew Burgess <aburgess@gcc.gnu.org>
Wed, 30 Nov 2016 11:08:06 +0000 (11:08 +0000)
commite9472c81d3efe5996e501348cc218c2ab79f3f38
tree20dcea3cae10d8f23d4bd700e09dc2746d4bb193
parenta7da4881303a7bc9a59014f0d03cd946a9cdecec
arc: Avoid store/load pipeline hazard

ARC700 targets have a store/load pipeline hazard, if we load within 2
cycles of a store, and the load/store are at the same address, then we
pay a multi-cycle penalty.

This commit avoids this by inserting nop instructions between the store
and the load.

gcc/ChangeLog:

* config/arc/arc-protos.h (arc_store_addr_hazard_p): Declare.
* config/arc/arc.c (arc_store_addr_hazard_p): New function.
(workaround_arc_anomaly): Call arc_store_addr_hazard_p for ARC700.
* config/arc/arc700.md: Add define_bypass for store/load.

gcc/testsuite/ChangeLog:

* gcc.target/arc/arc700-stld-hazard.c: New file.

From-SVN: r243007
gcc/ChangeLog
gcc/config/arc/arc-protos.h
gcc/config/arc/arc.c
gcc/config/arc/arc700.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arc/arc700-stld-hazard.c [new file with mode: 0644]