[all-commits] [llvm/llvm-project] fc10ad: [RISCV] Make single source reverse legal in isShuf...

Philip Reames via All-commits all-commits at lists.llvm.org
Wed Feb 5 18:13:20 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc10ad1a668675d50c81616486ea1065af53badb
      https://github.com/llvm/llvm-project/commit/fc10ad1a668675d50c81616486ea1065af53badb
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2025-02-05 (Wed, 05 Feb 2025)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-shuffle-reverse.ll

  Log Message:
  -----------
  [RISCV] Make single source reverse legal in isShuffleMaskLegal (#125949)

This enables DAG combines to form this mask. Reverse is generally linear
in LMUL so this is reasonable, and results in better codegen for the 2
source variants.

For <= m1, the change is only slightly profitable if at all. We trade
some mask creation and an extract vrsub for a vslideup.vi. This is
likely roughly neutral. At >= m2, this is distinctly profitable as
generic DAG pushes the reverse into the two operands. We effectively
already did this for one operand, but the other was hitting a full
O(LMUL^2) shuffle. Moving that to be O(LMUL/2) operation is a big win.



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