[llvm] [LV][EVL]Explicitly model AVL as sub, original TC, EVL_PHI. (PR #108869)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 00:34:46 PDT 2024


================
@@ -484,10 +484,7 @@ Value *VPInstruction::generatePerPart(VPTransformState &State, unsigned Part) {
     // TODO: Restructure this code with an explicit remainder loop, vsetvli can
     // be outside of the main loop.
     assert(Part == 0 && "No unrolling expected for predicated vectorization.");
-    // Compute VTC - IV as the AVL (requested vector length).
-    Value *Index = State.get(getOperand(0), VPIteration(0, 0));
-    Value *TripCount = State.get(getOperand(1), VPIteration(0, 0));
-    Value *AVL = State.Builder.CreateSub(TripCount, Index);
+    Value *AVL = State.get(getOperand(0), VPIteration(0, 0));
     Value *EVL = GetEVL(State, AVL);
----------------
ayalz wrote:

nit: simpler to inline GetEVL?

A follow-up thought: have a recipe for calling any intrinsic.

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


More information about the llvm-commits mailing list