[llvm-branch-commits] [llvm] [SelectionDAG][X86] Split via Concat <n x T> vector types for atomic load (PR #120640)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 29 06:34:52 PST 2025


================
@@ -7071,14 +7071,23 @@ static SDValue LowerAsSplatVectorLoad(SDValue SrcOp, MVT VT, const SDLoc &dl,
 }
 
 // Recurse to find a LoadSDNode source and the accumulated ByteOffest.
-static bool findEltLoadSrc(SDValue Elt, LoadSDNode *&Ld, int64_t &ByteOffset) {
-  if (ISD::isNON_EXTLoad(Elt.getNode())) {
-    auto *BaseLd = cast<LoadSDNode>(Elt);
-    if (!BaseLd->isSimple())
-      return false;
-    Ld = BaseLd;
-    ByteOffset = 0;
-    return true;
+template <typename T>
+static bool findEltLoadSrc(SDValue Elt, T *&Ld, int64_t &ByteOffset) {
----------------
jofrn wrote:

Yes, that's should be possible. Trying it out. (Need to ensure we do not combine consecutive elements that are not all atomic or all non-atomic.) With the templates, this happens naturally.

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


More information about the llvm-branch-commits mailing list