[AArch64] Fix shrinkwrapping interactions with atomics (PR92692)
authorWilco Dijkstra <wdijkstr@arm.com>
Fri, 17 Jan 2020 13:17:21 +0000 (13:17 +0000)
committerWilco Dijkstra <wdijkstr@arm.com>
Fri, 17 Jan 2020 13:17:21 +0000 (13:17 +0000)
commite5e07b68187b9aa334519746c45b8cffc5eb7e5c
tree6f5915fd6e2d44a27bcec52891749cf1d9c08128
parentf788c2d66a6ee1ded65dafccbc5e485d42af4808
[AArch64] Fix shrinkwrapping interactions with atomics (PR92692)

The separate shrinkwrapping pass may insert stores in the middle
of atomics loops which can cause issues on some implementations.
Avoid this by delaying splitting atomics patterns until after
prolog/epilog generation.

gcc/
PR target/92692
* config/aarch64/aarch64.c (aarch64_split_compare_and_swap)
Add assert to ensure prolog has been emitted.
(aarch64_split_atomic_op): Likewise.
* config/aarch64/atomics.md (aarch64_compare_and_swap<mode>)
Use epilogue_completed rather than reload_completed.
(aarch64_atomic_exchange<mode>): Likewise.
(aarch64_atomic_<atomic_optab><mode>): Likewise.
(atomic_nand<mode>): Likewise.
(aarch64_atomic_fetch_<atomic_optab><mode>): Likewise.
(atomic_fetch_nand<mode>): Likewise.
(aarch64_atomic_<atomic_optab>_fetch<mode>): Likewise.
(atomic_nand_fetch<mode>): Likewise.
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/atomics.md