[llvm] [VPlan] Replace ExtractFromEnd with Extract(Last|Penultimate)Lane (NFC). (PR #137030)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 25 01:14:31 PDT 2025
================
@@ -878,10 +878,11 @@ class VPInstruction : public VPRecipeWithIRFlags,
Broadcast,
ComputeFindLastIVResult,
ComputeReductionResult,
- // Takes the VPValue to extract from as first operand and the lane or part
- // to extract as second operand, counting from the end starting with 1 for
- // last. The second operand must be a positive constant and <= VF.
- ExtractFromEnd,
+ // Extracts the last lane from its operand if it is a vector, or the last
+ // part if scalar.
+ ExtractLast,
+ // Extracts the second-to-last lane from its operand.
+ ExtractPenultimateLane,
----------------
ayalz wrote:
This probably should be further clarified: extract penultimate is used also for part when VF=1, but gets replaced by hooking up to penultimate part during unrolling-by-UF (right?). So during code-gen extract penultimate expects VF>1, i.e., it's per lane rather than per part; but so does extract last? So perhaps better rename `ExtractPenultimate` too, explaining that both apply to lane or part, where the latter are abstract - dissolved prior to code-gen?
https://github.com/llvm/llvm-project/pull/137030
More information about the llvm-commits
mailing list