[llvm-branch-commits] [llvm] [X86] Cast atomic store in IR to support floats (PR #197861)

Matt Arsenault via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri May 15 04:20:52 PDT 2026


================
@@ -32967,6 +32967,19 @@ X86TargetLowering::shouldCastAtomicLoadInIR(LoadInst *LI) const {
   return AtomicExpansionKind::None;
 }
 
+TargetLowering::AtomicExpansionKind
+X86TargetLowering::shouldCastAtomicStoreInIR(StoreInst *SI) const {
+  Type *Ty = SI->getValueOperand()->getType();
+  if (!Ty->getScalarType()->isFloatingPointTy())
+    return AtomicExpansionKind::None;
+  // Sub-128-bit FP vectors codegen better when DAG widening folds the value
+  // into an extractelt-from-XMM pattern, instead of an IR-level bitcast to a
+  // scalar integer (which the type legalizer scalarizes).
----------------
arsenm wrote:

I think this is thinking too much about this. The goal is to fully remove shouldCastAtomicStoreInIR

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


More information about the llvm-branch-commits mailing list