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

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 13:53:58 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:

This might not be true if the ScalarizeMinBits option for the scalarizer pass is true.

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


More information about the llvm-commits mailing list