[llvm] [VPlan] Unroll VPReplicateRecipe by VF. (PR #142433)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 9 08:37:34 PDT 2025
================
@@ -604,6 +607,33 @@ Value *VPInstruction::generate(VPTransformState &State) {
return Builder.CreateVectorSplat(
State.VF, State.get(getOperand(0), /*IsScalar*/ true), "broadcast");
}
+ case VPInstruction::BuildVector: {
+ auto *ScalarTy = State.TypeAnalysis.inferScalarType(getOperand(0));
+ Value *Res = PoisonValue::get(
+ toVectorizedTy(ScalarTy, ElementCount::getFixed(getNumOperands())));
+ for (const auto &[Idx, Op] : enumerate(operands()))
+ Res = State.Builder.CreateInsertElement(Res, State.get(Op, true),
+ State.Builder.getInt32(Idx));
+ return Res;
+ }
+ case VPInstruction::BuildStructVector: {
+ // For struct types, we need to build a new 'wide' struct type, where each
+ // element is widened.
+ auto *STy =
----------------
ayalz wrote:
```suggestion
auto *StructTy =
```
https://github.com/llvm/llvm-project/pull/142433
More information about the llvm-commits
mailing list