[llvm] [Scalarizer][DirectX] support structs return types (PR #111569)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 06:36:22 PDT 2024


================
@@ -699,6 +728,18 @@ bool ScalarizerVisitor::splitCall(CallInst &CI) {
   if (isVectorIntrinsicWithOverloadTypeAtArg(ID, -1))
     Tys.push_back(VS->SplitTy);
 
+  if (AreAllVectors) {
+    Type *PrevType = CallType->getContainedType(0);
+    Type *CallType = CI.getType();
+    for (unsigned I = 1; I < CallType->getNumContainedTypes(); I++) {
+      Type *CurrType = cast<FixedVectorType>(CallType->getContainedType(I));
+      if (PrevType != CurrType) {
+        std::optional<VectorSplit> CurrVS = getVectorSplit(CurrType);
+        Tys.push_back(CurrVS->SplitTy);
----------------
bogner wrote:

I think just returning false is probably the right thing to do. Probably a check like the `if (!OpVS || OpVS->NumPacked != VS->NumPacked)` case below that comments on ScalarizeMinBits would be best.

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


More information about the llvm-commits mailing list