File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -27098,15 +27098,17 @@ AArch64TargetLowering::shouldExpandAtomicLoadInIR(LoadInst *LI) const {
27098
27098
27099
27099
// Return true if the atomic operation expansion will lower to use a library
27100
27100
// call, and is thus ineligible to use an LLSC expansion.
27101
- static bool rmwOpMayLowerToLibcall(const AtomicRMWInst *RMW) {
27101
+ static bool rmwOpMayLowerToLibcall(const AArch64Subtarget &Subtarget,
27102
+ const AtomicRMWInst *RMW) {
27102
27103
if (!RMW->isFloatingPointOperation())
27103
27104
return false;
27104
27105
switch (RMW->getType()->getScalarType()->getTypeID()) {
27105
27106
case Type::FloatTyID:
27106
27107
case Type::DoubleTyID:
27107
27108
case Type::HalfTyID:
27108
27109
case Type::BFloatTyID:
27109
- return false;
27110
+ // Will use soft float
27111
+ return !Subtarget.hasFPARMv8();
27110
27112
default:
27111
27113
// fp128 will emit library calls.
27112
27114
return true;
@@ -27161,7 +27163,7 @@ AArch64TargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const {
27161
27163
// succeed. So at -O0 lower this operation to a CAS loop. Also worthwhile if
27162
27164
// we have a single CAS instruction that can replace the loop.
27163
27165
if (getTargetMachine().getOptLevel() == CodeGenOptLevel::None ||
27164
- Subtarget->hasLSE() || rmwOpMayLowerToLibcall(AI))
27166
+ Subtarget->hasLSE() || rmwOpMayLowerToLibcall(*Subtarget, AI))
27165
27167
return AtomicExpansionKind::CmpXChg;
27166
27168
27167
27169
return AtomicExpansionKind::LLSC;
You can’t perform that action at this time.
0 commit comments