[llvm] [LV] Add initial support for vectorizing literal struct return values (PR #109833)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 03:42:19 PST 2025


================
@@ -8652,6 +8660,15 @@ VPWidenRecipe *VPRecipeBuilder::tryToWiden(Instruction *I,
       NewOps[1] = GetConstantViaSCEV(NewOps[1]);
     }
     return new VPWidenRecipe(*I, make_range(NewOps.begin(), NewOps.end()));
+  }
+  case Instruction::ExtractValue: {
+    SmallVector<VPValue *> NewOps(Operands);
+    Type *I32Ty = IntegerType::getInt32Ty(I->getContext());
+    for (unsigned Idx : cast<ExtractValueInst>(I)->getIndices())
----------------
david-arm wrote:

Shouldn't there only be one index? If there is more than one index will it even work? I assume that means we have structs of structs, which we don't currently support vectorising. Perhaps you can just assert there is only one index?

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


More information about the llvm-commits mailing list