[all-commits] [llvm/llvm-project] 6a77c9: [VPlan] Don't cost scalar IV steps if the vector b...

Florian Hahn via All-commits all-commits at lists.llvm.org
Tue Sep 8 12:46:11 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6a77c9113211f81804455102823b996e01283ffc
      https://github.com/llvm/llvm-project/commit/6a77c9113211f81804455102823b996e01283ffc
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2026-09-08 (Tue, 08 Sep 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
    M llvm/test/Transforms/LoopVectorize/AArch64/scalar-steps-cost.ll

  Log Message:
  -----------
  [VPlan] Don't cost scalar IV steps if the vector body runs at most once. (#221974)

If the vector loop executes exactly once, each scalar IV step folds to a
constant, and there's nothing to cost.

Similarly to BranchOnCount and VPRegionBlock::cost, treat
VPScalarIVSteps as free in that case.

This fixes a slight inaccuracy introduced when moving to computing
VPScalarIVSteps costs in VPlan directly.

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



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