[llvm] [LoopVectorize] Generate wide active lane masks (PR #147535)
Kerry McLaughlin via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 30 06:35:30 PDT 2025
================
@@ -846,6 +849,14 @@ Value *VPInstruction::generate(VPTransformState &State) {
Res->setName(Name);
return Res;
}
+ case VPInstruction::ExtractSubvector: {
+ Value *Vec = State.get(getOperand(0));
+ assert(State.VF.isVector());
+ auto Idx = cast<ConstantInt>(getOperand(1)->getLiveInIRValue());
+ auto ResTy = VectorType::get(
+ State.TypeAnalysis.inferScalarType(getOperand(0)), State.VF);
+ return Builder.CreateExtractVector(ResTy, Vec, Idx);
----------------
kmclaughlin-arm wrote:
I did initially use VPWidenIntrinsic when I started working on this, but I wasn't sure if that should only be used when the intrinsic exists in the original IR. I've changed this back to use VPWidenIntrinsic to create a `vector_extract` now.
https://github.com/llvm/llvm-project/pull/147535
More information about the llvm-commits
mailing list