[all-commits] [llvm/llvm-project] 39e63b: [IR][CostModel] A scalable vector shuffle can't be...

Craig Topper via All-commits all-commits at lists.llvm.org
Mon May 9 21:47:32 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 39e63bd2d848667e44fc05d8a39460f29a3dfbe1
      https://github.com/llvm/llvm-project/commit/39e63bd2d848667e44fc05d8a39460f29a3dfbe1
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-05-09 (Mon, 09 May 2022)

  Changed paths:
    M llvm/include/llvm/IR/Instructions.h
    M llvm/lib/IR/Instructions.cpp
    M llvm/test/Analysis/CostModel/RISCV/rvv-shuffle.ll
    M llvm/test/Analysis/CostModel/RISCV/shuffle-broadcast.ll

  Log Message:
  -----------
  [IR][CostModel] A scalable vector shuffle can't be an identity or reverse shuffle.

Even if the minimum number of elements is 1 and the length doesn't change,
we don't know what vscale is so we can't classify it as identity mask. Instead it
is a zero element splat.

For reverse, we shouldn't classify it as a reverse unless there are at least 2 elements
in the mask. This applies to both fixed and scalable vectors. For fixed vectors, a single
element would be an identity shuffle. For scalable vector it's a zero elt splat.

Reviewed By: sdesmalen, liaolucy

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




More information about the All-commits mailing list