[llvm] [AMDGPU] In VectorLegalizer::Expand, if UnrollVectorOp returns Load, … (PR #88475)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 12 06:11:47 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));
----------------
arsenm wrote:
Special casing the return values is the wrong fix. UnrollVectorOp should have a consistent return scheme. The accounting in UnrollVectorOp isn't accounting for chain operands; I think the getNumValues == 2 check in UnrollVectorOp should be discounting chain outputs
https://github.com/llvm/llvm-project/pull/88475
More information about the llvm-commits
mailing list