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 @@ -27069,15 +27069,17 @@ AArch64TargetLowering::shouldExpandAtomicLoadInIR(LoadInst *LI) const {
27069
27069
27070
27070
// Return true if the atomic operation expansion will lower to use a library
27071
27071
// call, and is thus ineligible to use an LLSC expansion.
27072
- static bool rmwOpMayLowerToLibcall(const AtomicRMWInst *RMW) {
27072
+ static bool rmwOpMayLowerToLibcall(const AArch64Subtarget &Subtarget,
27073
+ const AtomicRMWInst *RMW) {
27073
27074
if (!RMW->isFloatingPointOperation())
27074
27075
return false;
27075
27076
switch (RMW->getType()->getScalarType()->getTypeID()) {
27076
27077
case Type::FloatTyID:
27077
27078
case Type::DoubleTyID:
27078
27079
case Type::HalfTyID:
27079
27080
case Type::BFloatTyID:
27080
- return false;
27081
+ // Will use soft float
27082
+ return !Subtarget.hasFPARMv8();
27081
27083
default:
27082
27084
// fp128 will emit library calls.
27083
27085
return true;
@@ -27132,7 +27134,7 @@ AArch64TargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const {
27132
27134
// succeed. So at -O0 lower this operation to a CAS loop. Also worthwhile if
27133
27135
// we have a single CAS instruction that can replace the loop.
27134
27136
if (getTargetMachine().getOptLevel() == CodeGenOptLevel::None ||
27135
- Subtarget->hasLSE() || rmwOpMayLowerToLibcall(AI))
27137
+ Subtarget->hasLSE() || rmwOpMayLowerToLibcall(*Subtarget, AI))
27136
27138
return AtomicExpansionKind::CmpXChg;
27137
27139
27138
27140
return AtomicExpansionKind::LLSC;
You can’t perform that action at this time.
0 commit comments