AArch64 - disable CB[N]Z TB[N]Z when tracking speculation 68/198468/2
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jul 2018 17:36:09 +0000 (17:36 +0000)
committerDongkyun Son <dongkyun.s@samsung.com>
Wed, 6 Feb 2019 15:53:54 +0000 (15:53 +0000)
commit233eedd720a30dc4552a3310792871e8156e8076
treee136a5637597ce7237d3153103cfaeea9cf3889d
parentdc1279d6da8e406489871229a4778e55f4177bef
AArch64 - disable CB[N]Z TB[N]Z when tracking speculation

The CB[N]Z and TB[N]Z instructions do not expose the comparison through
the condition code flags.  This makes it impossible to track speculative
execution through such a branch.  We can handle this relatively easily
by simply disabling the patterns in this case.

A side effect of this is that the split patterns for the atomic operations
need to also avoid generating these instructions.  They mostly have simple
fall-backs for this already.

* config/aarch64/aarch64.md (cb<optab><mode>1): Disable when
aarch64_track_speculation is true.
(tb<optab><mode>1): Likewise.
* config/aarch64/aarch64.c (aarch64_split_compare_regs): Do not
generate CB[N]Z when tracking speculation.
(aarch64_split_compare_and_swap): Likewise.
(aarch64_split_atomic_op): Likewise.

(backported eaf891585b16ef84046ae73a01bb1c7189c682e9)

Change-Id: I0d0a090ef7bcf074b9e4d6ee115e71faa157962f
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263172 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.md