summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2017-11-30 20:11:42 +0000
committerDaniel Sanders <daniel_l_sanders@apple.com>2017-11-30 20:11:42 +0000
commitaef1dfc690adc6478efcd059bdbb65d0195082b8 (patch)
tree93e7e991529cc394ef6593a962e1217705fd88e1 /llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
parentd78d65c2a4eed16b273c214d24f5d5f55ce31d52 (diff)
downloadbcm5719-llvm-aef1dfc690adc6478efcd059bdbb65d0195082b8.tar.gz
bcm5719-llvm-aef1dfc690adc6478efcd059bdbb65d0195082b8.zip
[aarch64][globalisel] Legalize G_ATOMIC_CMPXCHG_WITH_SUCCESS and G_ATOMICRMW_*
G_ATOMICRMW_* is generally legal on AArch64. The exception is G_ATOMICRMW_NAND. G_ATOMIC_CMPXCHG_WITH_SUCCESS needs to be lowered to G_ATOMIC_CMPXCHG with an external comparison. Note that IRTranslator doesn't generate these instructions yet. llvm-svn: 319466
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
index 54d1109a08f..c7a42629c96 100644
--- a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
@@ -351,8 +351,10 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST) {
setAction({G_VAARG, Ty}, Custom);
if (ST.hasLSE()) {
- for (auto Ty : {s8, s16, s32, s64})
+ for (auto Ty : {s8, s16, s32, s64}) {
+ setAction({G_ATOMIC_CMPXCHG_WITH_SUCCESS, Ty}, Lower);
setAction({G_ATOMIC_CMPXCHG, Ty}, Legal);
+ }
setAction({G_ATOMIC_CMPXCHG, 1, p0}, Legal);
for (unsigned Op :
OpenPOWER on IntegriCloud