[llvm-branch-commits] [llvm] [SelectionDAG] Split vector types for atomic store (PR #197860)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri May 15 04:03:14 PDT 2026


================
@@ -4704,6 +4707,23 @@ SDValue DAGTypeLegalizer::SplitVecOp_STORE(StoreSDNode *N, unsigned OpNo) {
   return DAG.getNode(ISD::TokenFactor, DL, MVT::Other, Lo, Hi);
 }
 
+SDValue DAGTypeLegalizer::SplitVecOp_ATOMIC_STORE(AtomicSDNode *N) {
+  SDLoc DL(N);
+  SDValue StVal = N->getVal();
+  EVT VT = StVal.getValueType();
+
+  // Issue a single atomic store of an integer that spans the full memory
+  // width. Bitcasting the (illegal) vector value to that integer lets the
+  // type legalizer further legalize the BITCAST input as needed, while the
+  // ATOMIC_STORE itself uses only the legal integer type.
+  EVT IntVT = EVT::getIntegerVT(*DAG.getContext(), VT.getSizeInBits());
----------------
jofrn wrote:

It does apply to those; however, it doesn't matter per se that there is no legal type if so since AtomicExpand.cpp's `atomicSizeSupported`'s call to `TLI->getMaxAtomicSizeInBitsSupported() / 8` will lower these types to library calls instead, i.e. before the DAG lowers them.

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


More information about the llvm-branch-commits mailing list