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

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 07:39:34 PDT 2024


================
@@ -122,6 +122,8 @@ Type *VPTypeAnalysis::inferScalarTypeForRecipe(const VPWidenRecipe *R) {
   case Instruction::FNeg:
   case Instruction::Freeze:
     return inferScalarType(R->getOperand(0));
+  case Instruction::ExtractValue:
+    return R->getUnderlyingInstr()->getType();
----------------
MacDue wrote:

Yes that works, and now that the extract indices are in the vplan, that does not require looking at the underlying value. 

P.s. I was wrong before, this should always return a scalar for `extractvalue`, as this patch only allow widening structs of scalars. 

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


More information about the llvm-commits mailing list