[all-commits] [llvm/llvm-project] 3f5d17: [SLP]Vectorize bool-to-bitmask reductions as a bit...

Alexey Bataev via All-commits all-commits at lists.llvm.org
Tue Sep 22 11:35:44 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f5d17b22586bd080c62d5b294bd05c0dc282ba4
      https://github.com/llvm/llvm-project/commit/3f5d17b22586bd080c62d5b294bd05c0dc282ba4
  Author: Alexey Bataev <a.bataev at outlook.com>
  Date:   2026-09-22 (Tue, 22 Sep 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    M llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCostAnalysis.cpp
    M llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCostAnalysis.h
    M llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPReductionUtils.cpp
    M llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPReductionUtils.h
    M llvm/test/Transforms/SLPVectorizer/AArch64/narrowed-reduction-chain-use.ll
    M llvm/test/Transforms/SLPVectorizer/X86/bool-mask.ll

  Log Message:
  -----------
  [SLP]Vectorize bool-to-bitmask reductions as a bitcast of zero tests

An or-reduction of boolean leaves each shifted by their own bit position
(an array of bools packed into a bitmask) is a bitcast of the per-lane
zero tests to an integer, which the backend lowers to a movmsk (X86).
Emit that instead of the shift and reduce sequence when it is cheaper.

Fixes #41997

Assisted-by: Cursor

Reviewers: RKSimon

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



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