[all-commits] [llvm/llvm-project] 1c722f: [RISCV][TTI] Use processShuffleMask for shuffle le...

Philip Reames via All-commits all-commits at lists.llvm.org
Tue Apr 22 10:50:42 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c722fc8f5671ab1bbb7965b3b5fbba0645884b0
      https://github.com/llvm/llvm-project/commit/1c722fc8f5671ab1bbb7965b3b5fbba0645884b0
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2025-04-22 (Tue, 22 Apr 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/RISCV/shuffle-exact-vlen.ll
    M llvm/test/Analysis/CostModel/RISCV/shuffle-permute.ll
    M llvm/test/Transforms/SLPVectorizer/RISCV/reductions.ll

  Log Message:
  -----------
  [RISCV][TTI] Use processShuffleMask for shuffle legalization estimate (#136191)

We had some code which tried to estimate legalization costs for
illegally typed shuffles, but it only handled the case of a widening
shuffle, and used a somewhat adhoc heuristic. We can reuse the
processShuffleMask utility (which we already use for individual vector
register splitting when exact VLEN is known) to perform the same
splitting given the legal vector type as the unit of split instead. This
makes the costing both simpler and more robust.

Note that this swings costs for illegal shuffles pretty wildly as we
were previously sometimes hitting the adhoc code, and sometimes falling
through into generic scalarization costing. I don't know that any of the
costs for the individual tests in tree are significant, but the test
which which triggered me finding this was reported to me by Alexey
reduced from something triggering a bad choice in SLP for x264. So this
has the potential to be somewhat high impact.



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