[all-commits] [llvm/llvm-project] 8d86dc: [SLP] Fix extract-cost scale using NCD of all exte...

Alexey Bataev via All-commits all-commits at lists.llvm.org
Sat May 30 04:44:01 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8d86dc22be4f474ad102664d1cc0374a35732625
      https://github.com/llvm/llvm-project/commit/8d86dc22be4f474ad102664d1cc0374a35732625
  Author: Alexey Bataev <a.bataev at outlook.com>
  Date:   2026-05-30 (Sat, 30 May 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    M llvm/test/Transforms/SLPVectorizer/AArch64/lcssa-phi-extract-scale.ll

  Log Message:
  -----------
  [SLP] Fix extract-cost scale using NCD of all external-user sites

ExtractCostCalculated deduplicates by scalar so only the first
ExternalUser determines the scale, making the cost depend on IR block
ordering via LLVM's reverse-insertion use-list order.
Add a pre-pass computing ScalarToExtractBlock - the nearest common
dominator of all effective extract sites per scalar. For PHI users inside
a loop the effective site is the incoming block; for PHI users outside
all loops it is the PHI's own block (scale = 1). The extract cost is
then scaled by getLoopNestScale of the NCD block, which is fully
order-independent.

Fixes #199548

Reviewers: bababuck, RKSimon, hiraditya

Pull Request: https://github.com/llvm/llvm-project/pull/199962



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