[all-commits] [llvm/llvm-project] e90f46: [SLP] Normalize copyable operand order via majorit...

Alexey Bataev via All-commits all-commits at lists.llvm.org
Thu Apr 16 09:57:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e90f463db5c2d28ae0d65e2ceccfaa03d4ea7c53
      https://github.com/llvm/llvm-project/commit/e90f463db5c2d28ae0d65e2ceccfaa03d4ea7c53
  Author: Alexey Bataev <a.bataev at outlook.com>
  Date:   2026-04-16 (Thu, 16 Apr 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    M llvm/test/Transforms/SLPVectorizer/X86/bottom-to-top-reorder.ll
    M llvm/test/Transforms/SLPVectorizer/X86/copyable_reorder.ll
    M llvm/test/Transforms/SLPVectorizer/X86/operand-reorder-with-copyables.ll
    M llvm/test/Transforms/SLPVectorizer/X86/reused-last-instruction-in-split-node.ll

  Log Message:
  -----------
  [SLP] Normalize copyable operand order via majority voting

When building operands for entries with copyable elements, non-copyable
lanes of commutative ops may have inconsistent operand order (e.g. some
lanes have load,add while others have add,load). This prevents
VLOperands::reorder() from grouping consecutive loads on one side,
degrading downstream vectorization.
Add majority-voting normalization during buildOperands: track the
(ValueID, ValueID) pair frequency across non-copyable lanes and swap
any lane whose operand types are the exact inverse of the most common
pattern. This makes operand order consistent, enabling better load
grouping.
This is part 1 of #189181.

Reviewers: RKSimon, hiraditya

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



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