[all-commits] [llvm/llvm-project] 6098d7: [RISCV] Lower shuffles as rotates without zvbb

Luke Lau via All-commits all-commits at lists.llvm.org
Mon Sep 4 01:35:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6098d7d5f6533edb1b873107ddc1acde23b9235b
      https://github.com/llvm/llvm-project/commit/6098d7d5f6533edb1b873107ddc1acde23b9235b
  Author: Luke Lau <luke at igalia.com>
  Date:   2023-09-04 (Mon, 04 Sep 2023)

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

  Log Message:
  -----------
  [RISCV] Lower shuffles as rotates without zvbb

Now that the codegen for the expanded ISD::ROTL sequence has been improved,
it's probably profitable to lower a shuffle that's a rotate to the
vsll+vsrl+vor sequence to avoid a vrgather where possible, even if we don't
have the vror instruction.

This patch relaxes the restriction on ISD::ROTL being legal in
lowerVECTOR_SHUFFLEAsRotate. It also attempts to do the lowering twice: Once
if zvbb is enabled before any of the interleave/deinterleave/vmerge lowerings,
and a second time unconditionally just before it falls back to the vrgather.
This way it doesn't interfere with any of the above patterns that may be more
profitable than the expanded ISD::ROTL sequence.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D159353




More information about the All-commits mailing list