mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 00:54:48 +08:00
[AArch64] Make the list of LSE supported operations explicit (#171126)
Similar to #167760 this makes the list of LSE atomics explicit in case new operations are added in the future. UIncWrap, UDecWrap, USubCond and USubSat are excluded. Fixes #170450
This commit is contained in:
@@ -29759,12 +29759,26 @@ AArch64TargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const {
|
||||
AI->getOperation() == AtomicRMWInst::FMinimum))
|
||||
return AtomicExpansionKind::None;
|
||||
|
||||
// Nand is not supported in LSE.
|
||||
// Leave 128 bits to LLSC or CmpXChg.
|
||||
if (AI->getOperation() != AtomicRMWInst::Nand && Size < 128 &&
|
||||
!AI->isFloatingPointOperation()) {
|
||||
if (Subtarget->hasLSE())
|
||||
return AtomicExpansionKind::None;
|
||||
if (Size < 128 && !AI->isFloatingPointOperation()) {
|
||||
if (Subtarget->hasLSE()) {
|
||||
// Nand is not supported in LSE.
|
||||
switch (AI->getOperation()) {
|
||||
case AtomicRMWInst::Xchg:
|
||||
case AtomicRMWInst::Add:
|
||||
case AtomicRMWInst::Sub:
|
||||
case AtomicRMWInst::And:
|
||||
case AtomicRMWInst::Or:
|
||||
case AtomicRMWInst::Xor:
|
||||
case AtomicRMWInst::Max:
|
||||
case AtomicRMWInst::Min:
|
||||
case AtomicRMWInst::UMax:
|
||||
case AtomicRMWInst::UMin:
|
||||
return AtomicExpansionKind::None;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (Subtarget->outlineAtomics()) {
|
||||
// [U]Min/[U]Max RWM atomics are used in __sync_fetch_ libcalls so far.
|
||||
// Don't outline them unless
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user