Skip to content

Commit 79d5e6d

Browse files
committed
[AArch64] Make the list of outline atomic supported operations explicit
As new operations are added (for example uinc_wrap, udec_wrap, usub_cond, usub_sat), they will not automatically be supported by outline atomics and so should be expanded by the pre-isel pass. Make the list of supported outline atommics explicit to make sure we only mark the expected intrinsics as outline atomics. Fixes #167728
1 parent 6ad25c5 commit 79d5e6d

File tree

2 files changed

+345
-26
lines changed

2 files changed

+345
-26
lines changed

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29309,11 +29309,16 @@ AArch64TargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const {
2930929309
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0493r1.pdf
2931029310
// (2) low level libgcc and compiler-rt support implemented by:
2931129311
// min/max outline atomics helpers
29312-
if (AI->getOperation() != AtomicRMWInst::Min &&
29313-
AI->getOperation() != AtomicRMWInst::Max &&
29314-
AI->getOperation() != AtomicRMWInst::UMin &&
29315-
AI->getOperation() != AtomicRMWInst::UMax) {
29312+
switch (AI->getOperation()) {
29313+
case AtomicRMWInst::Xchg:
29314+
case AtomicRMWInst::Add:
29315+
case AtomicRMWInst::Sub:
29316+
case AtomicRMWInst::And:
29317+
case AtomicRMWInst::Or:
29318+
case AtomicRMWInst::Xor:
2931629319
return AtomicExpansionKind::None;
29320+
default:
29321+
break;
2931729322
}
2931829323
}
2931929324
}

0 commit comments

Comments
 (0)