[llvm] [VPlan] Use pointer to member 0 as VPInterleaveRecipe's pointer arg. (PR #106431)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 10:01:19 PDT 2024


================
@@ -2413,10 +2414,11 @@ void VPInterleaveRecipe::execute(VPTransformState &State) {
     Idx = State.Builder.CreateSub(RuntimeVF, State.Builder.getInt32(1));
     Idx = State.Builder.CreateMul(Idx,
                                   State.Builder.getInt32(Group->getFactor()));
-    Idx = State.Builder.CreateAdd(Idx, State.Builder.getInt32(Index));
     Idx = State.Builder.CreateNeg(Idx);
-  } else
-    Idx = State.Builder.getInt32(-Index);
+  } else {
+    // TODO: Drop redundant 0-index GEP as follow-up.
----------------
ayalz wrote:

Indeed, better keep Idx null if not needed, to refrain from generating a redundant gep with zero.

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


More information about the llvm-commits mailing list