[all-commits] [llvm/llvm-project] 2545a1: [VPlan] Compute cost of some VPWidenIntOrFpInducti...

Florian Hahn via All-commits all-commits at lists.llvm.org
Wed Jul 29 05:03:04 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2545a108f4d173ed509e3eea33753227bdd6f847
      https://github.com/llvm/llvm-project/commit/2545a108f4d173ed509e3eea33753227bdd6f847
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2026-07-29 (Wed, 29 Jul 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.h
    M llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
    M llvm/test/Transforms/LoopVectorize/AArch64/cmp_cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/fully-unrolled-cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-inductions-unusual-types.ll
    M llvm/test/Transforms/LoopVectorize/X86/CostModel/vpinstruction-cost.ll
    M llvm/test/Transforms/LoopVectorize/X86/cost-model-i386.ll
    M llvm/test/Transforms/LoopVectorize/X86/induction-costs.ll
    M llvm/test/Transforms/LoopVectorize/induction-cost.ll

  Log Message:
  -----------
  [VPlan] Compute cost of some VPWidenIntOrFpInductions in VPlan (#202232)

Add initial implementation of VPWidenIntOrFpInductionRecipe::computeCost,
handling un-truncated inductions.

For the first patch, only compute costs in VPlan if there are no
truncated inductions (in that case, there are additional differences for
the cost model, as previously we would not cost the truncate properly)
and the vector loop won't get unrolled (no induction cost).

Note that some decision change. This is due to the legacy cost model
computing the cost of the original IR, where the induction is scaled in
the loop in each iteration (e.g. with mul), while in the vector loop we
scale the increment, and there is just an add to increment the
induction. This is more accurate than the legacy cost computation.

PR: https://github.com/llvm/llvm-project/pull/202232



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