[PATCH] D116277: [RISCV] Use vmv.s.x to build one element splat vector.

Jianjian Guan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 4 01:11:59 PST 2022


jacquesguan added a comment.

In D116277#3217882 <https://reviews.llvm.org/D116277#3217882>, @craig.topper wrote:

> This patch only seems to handle reductions and vmv.v.x intrinsics. A single element BUILD_VECTOR would still produce a vmv.v.x.
>
>> I think that vmv.s.x has less demand on VL and VTYPE, so using vmv.s.x instead vmv.v.x might reduce the amount of VSETVLI instructions that we will insert.
>
> Do any of the test cases show this benefit? If not, can you create one?

Yes, there are serval cases that already show the changes, for example, `llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp.ll` and `llvm/test/CodeGen/RISCV/rvv/fixed-vectors-reduction-fp.ll`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116277/new/

https://reviews.llvm.org/D116277



More information about the llvm-commits mailing list