[llvm] [AMDGPU] In VectorLegalizer::Expand, if UnrollVectorOp returns Load, … (PR #88475)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 12 14:45:04 PDT 2024


================
@@ -1159,8 +1159,12 @@ void VectorLegalizer::Expand(SDNode *Node, SmallVectorImpl<SDValue> &Results) {
   }
 
   SDValue Unrolled = DAG.UnrollVectorOp(Node);
-  for (unsigned I = 0, E = Unrolled->getNumValues(); I != E; ++I)
-    Results.push_back(Unrolled.getValue(I));
+  const LoadSDNode *Ld = dyn_cast<LoadSDNode>(Unrolled.getNode());
+  if (Ld)
+    Results.push_back(Unrolled);
+  else
+    for (unsigned I = 0, E = Unrolled->getNumValues(); I != E; ++I)
+      Results.push_back(Unrolled.getValue(I));
----------------
topperc wrote:

Is the correct fix just to use Node->getNumValues() instead of Unrolled->getNumValues()?

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


More information about the llvm-commits mailing list