[llvm-branch-commits] [llvm] AArch64: Use consistent atomicrmw expansion for FP operations (PR #103702)

Eli Friedman via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 22 12:28:48 PDT 2024


================
@@ -27056,21 +27056,35 @@ AArch64TargetLowering::shouldExpandAtomicLoadInIR(LoadInst *LI) const {
                              : AtomicExpansionKind::LLSC;
 }
 
+// Return true if the atomic operation expansion will lower to use a library
+// call, and is thus ineligible to use an LLSC expansion.
+static bool rmwOpMayLowerToLibcall(const AtomicRMWInst *RMW) {
+  if (!RMW->isFloatingPointOperation())
+    return false;
+  switch (RMW->getType()->getScalarType()->getTypeID()) {
+  case Type::FloatTyID:
+  case Type::DoubleTyID:
+  case Type::HalfTyID:
+  case Type::BFloatTyID:
+    return false;
----------------
efriedma-quic wrote:

We need to check if we're in softfp mode (`Subtarget->hasFPARMv8()`).

https://github.com/llvm/llvm-project/pull/103702


More information about the llvm-branch-commits mailing list