[llvm] [Scalarizer][DirectX] support structs return types (PR #111569)
Tex Riddell via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 18 14:09:23 PDT 2024
================
@@ -699,6 +730,20 @@ bool ScalarizerVisitor::splitCall(CallInst &CI) {
if (isVectorIntrinsicWithOverloadTypeAtArg(ID, -1))
Tys.push_back(VS->SplitTy);
+ if (AreAllVectorsOfMatchingSize) {
+ for (unsigned I = 1; I < CallType->getNumContainedTypes(); I++) {
+ if (isVectorIntrinsicWithStructReturnOverloadAtField(ID, I)) {
+ std::optional<VectorSplit> CurrVS = getVectorSplit(
+ cast<FixedVectorType>(CallType->getContainedType(I)));
+ // This case does not seem to happen, but it is possible for
+ // VectorSplit.NumPacked >= NumElems. If that happens a VectorSplit
+ // is not returned and we will bailout of handling this call.
+ if (!CurrVS)
+ return false;
+ Tys.push_back(CurrVS->SplitTy);
+ }
----------------
tex3d wrote:
Note: I had also modified the comment from `This case does not seem to happen, ...`, since it can happen when `ScalarizeMinBits` is used.
https://github.com/llvm/llvm-project/pull/111569
More information about the llvm-commits
mailing list