[llvm] [AMDGPU] Fix selection of s_load_b96 on GFX11 (PR #108029)

Piotr Sobczak via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 09:11:35 PDT 2024


================
@@ -10334,24 +10335,24 @@ SDValue SITargetLowering::LowerLOAD(SDValue Op, SelectionDAG &DAG) const {
     // have the same legalization requirements as global and private
     // loads.
     //
-  }
 
-  if (AS == AMDGPUAS::CONSTANT_ADDRESS ||
-      AS == AMDGPUAS::CONSTANT_ADDRESS_32BIT ||
-      AS == AMDGPUAS::GLOBAL_ADDRESS) {
-    if (Subtarget->getScalarizeGlobalBehavior() && !Op->isDivergent() &&
-        Load->isSimple() && isMemOpHasNoClobberedMemOperand(Load) &&
-        Alignment >= Align(4) && NumElements < 32) {
-      if (MemVT.isPow2VectorType() ||
-          (Subtarget->hasScalarDwordx3Loads() && NumElements == 3))
-        return SDValue();
-      return WidenOrSplitVectorLoad(Op, DAG);
+    if (AS == AMDGPUAS::CONSTANT_ADDRESS ||
+        AS == AMDGPUAS::CONSTANT_ADDRESS_32BIT ||
+        AS == AMDGPUAS::GLOBAL_ADDRESS) {
+      if (Subtarget->getScalarizeGlobalBehavior() && Load->isSimple() &&
+          isMemOpHasNoClobberedMemOperand(Load)) {
+        if (MemVT.isPow2VectorType() ||
+            (Subtarget->hasScalarDwordx3Loads() && NumElements == 3))
+          return SDValue();
+        return WidenOrSplitVectorLoad(Op, DAG);
+      }
+      // Non-uniform loads will be selected to MUBUF instructions, so they
+      // have the same legalization requirements as global and private
+      // loads.
+      //
     }
-    // Non-uniform loads will be selected to MUBUF instructions, so they
-    // have the same legalization requirements as global and private
-    // loads.
-    //
   }
+
----------------
piotrAMD wrote:

Nit: Spurious extra line.

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


More information about the llvm-commits mailing list