diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2017-01-18 18:23:34 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2017-01-18 18:23:34 +0000 |
commit | 9bca63d44bf10ac1341f44b86b1c0f5b1ca5bc1b (patch) | |
tree | 269f0067f0a513c19642c0a53e0cab3c239dad9f /gcc | |
parent | 90553aacf81daa11af51e62f687c0d5460ec1ee7 (diff) | |
download | gcc-9bca63d44bf10ac1341f44b86b1c0f5b1ca5bc1b.zip gcc-9bca63d44bf10ac1341f44b86b1c0f5b1ca5bc1b.tar.gz gcc-9bca63d44bf10ac1341f44b86b1c0f5b1ca5bc1b.tar.bz2 |
SHA1H instructions may be scheduled after a SHA1C instruction that uses the same input register.
SHA1H instructions may be scheduled after a SHA1C instruction
that uses the same input register. However SHA1C updates its input,
so if SHA1H is scheduled after it, it requires an extra move.
Increase the priority of SHA1H to ensure it gets scheduled
earlier, avoiding the move.
gcc/
* config/aarch64/aarch64.c (aarch64_sched_adjust_priority)
New function.
(TARGET_SCHED_ADJUST_PRIORITY): Define target hook.
From-SVN: r244586
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8c4b988..507320d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-01-18 Wilco Dijkstra <wdijkstr@arm.com> + + * config/aarch64/aarch64.c (aarch64_sched_adjust_priority) + New function. + (TARGET_SCHED_ADJUST_PRIORITY): Define target hook. + 2017-01-18 Maxim Ostapenko <m.ostapenko@samsung.com> PR lto/79061 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 27f2dc9..39a5880 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -14070,6 +14070,26 @@ aarch64_sched_fusion_priority (rtx_insn *insn, int max_pri, return; } +/* Implement the TARGET_SCHED_ADJUST_PRIORITY hook. + Adjust priority of sha1h instructions so they are scheduled before + other SHA1 instructions. */ + +static int +aarch64_sched_adjust_priority (rtx_insn *insn, int priority) +{ + rtx x = PATTERN (insn); + + if (GET_CODE (x) == SET) + { + x = SET_SRC (x); + + if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_SHA1H) + return priority + 10; + } + + return priority; +} + /* Given OPERANDS of consecutive load/store, check if we can merge them into ldp/stp. LOAD is true if they are load instructions. MODE is the mode of memory operands. */ @@ -14991,6 +15011,9 @@ aarch64_libgcc_floating_mode_supported_p #undef TARGET_CAN_USE_DOLOOP_P #define TARGET_CAN_USE_DOLOOP_P can_use_doloop_if_innermost +#undef TARGET_SCHED_ADJUST_PRIORITY +#define TARGET_SCHED_ADJUST_PRIORITY aarch64_sched_adjust_priority + #undef TARGET_SCHED_MACRO_FUSION_P #define TARGET_SCHED_MACRO_FUSION_P aarch64_macro_fusion_p |