[all-commits] [llvm/llvm-project] db7d04: [NFC][VPlan] Add initial tests for future VPlan-ba...

Andrei Elovikov via All-commits all-commits at lists.llvm.org
Mon Mar 2 16:40:38 PST 2026


  Branch: refs/heads/users/eas/vplan-based-stride-mv-rt-guard
  Home:   https://github.com/llvm/llvm-project
  Commit: db7d04d3937085784fd1d790402c8ff79f0d4b56
      https://github.com/llvm/llvm-project/commit/db7d04d3937085784fd1d790402c8ff79f0d4b56
  Author: Andrei Elovikov <andrei.elovikov at sifive.com>
  Date:   2026-03-02 (Mon, 02 Mar 2026)

  Changed paths:
    A llvm/test/Transforms/LoopVectorize/VPlan/vplan-based-stride-mv.ll
    A llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv.ll

  Log Message:
  -----------
  [NFC][VPlan] Add initial tests for future VPlan-based stride MV

I tried to include both the features that current
LoopAccessAnalysis-based transformation supports (e.g., trunc/sext of
stride) but also cases where the current implementation behaves poorly,
e.g., https://godbolt.org/z/h31c3zKxK; as well as some other potentially
interesting scenarios I could imagine.

The are two test files with the same content. One is for VPlan dump change of
the future transformation alone (I'll update `-vplan-print-after` in the next
PR), another is for the full vectorizer pipeline. The latter have two `RUN:`
lines:
 * No multiversioning, so the next PR diff can show the transformation itself
 * Stride multiversionin performed in LAA, so that we can compare future
   VPlan-based transformation vs old behavior.


  Commit: c13d7767cf69bcaca08edb34b638414490c014ba
      https://github.com/llvm/llvm-project/commit/c13d7767cf69bcaca08edb34b638414490c014ba
  Author: Andrei Elovikov <andrei.elovikov at sifive.com>
  Date:   2026-03-02 (Mon, 02 Mar 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.h
    M llvm/test/Transforms/LoopVectorize/VPlan/vplan-print-after-all.ll
    M llvm/test/Transforms/LoopVectorize/X86/drop-poison-generating-flags.ll
    M llvm/test/Transforms/LoopVectorize/pr37248.ll
    M llvm/test/Transforms/LoopVectorize/runtime-check-needed-but-empty.ll

  Log Message:
  -----------
  [VPlan] Scalarize to first-lane-only directly on VPlan

This is needed to enable subsequent https://github.com/llvm/llvm-project/pull/182595.

I don't think we can fully port all scalarization logic from the legacy
path to VPlan-based right now because that would require us to introduce
interleave groups much earlier in VPlan pipeline, and without that we
can't really `assert` this new decision matches the previous CM-based
one. And without those `assert`s it's really hard to ensure we properly
port all the previous logic.

As such, I decided just to implement something much simpler that would
be enough for #182595. However, we perform this transformation before
delegating to the old CM-based decision, so it **is** effective
immediately and taking precedence even for consecutive loads/stores
right away.

Depends on https://github.com/llvm/llvm-project/pull/182592 but is stacked on
top of https://github.com/llvm/llvm-project/pull/182594 to enable linear
stacking for https://github.com/llvm/llvm-project/pull/182595.


  Commit: 410385599759309c5ed5c7bc035bd97863210cca
      https://github.com/llvm/llvm-project/commit/410385599759309c5ed5c7bc035bd97863210cca
  Author: Andrei Elovikov <andrei.elovikov at sifive.com>
  Date:   2026-03-02 (Mon, 02 Mar 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
    M llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h
    M llvm/lib/Transforms/Vectorize/VPlan.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.h
    M llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
    M llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
    M llvm/lib/Transforms/Vectorize/VPlanTransforms.h
    M llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
    M llvm/test/Transforms/LoopVectorize/VPlan/vplan-based-stride-mv.ll
    M llvm/test/Transforms/LoopVectorize/vplan-based-stride-mv.ll

  Log Message:
  -----------
  [VPlan] Implement VPlan-based stride speculation


Compare: https://github.com/llvm/llvm-project/compare/2c99c01a69e5...410385599759

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list