[all-commits] [llvm/llvm-project] d399b8: [RISCV] Maintain fixed-length info when optimizing...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Fri Mar 19 10:27:59 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d399b82e2ab26b38745852534e85771dee4de296
      https://github.com/llvm/llvm-project/commit/d399b82e2ab26b38745852534e85771dee4de296
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-03-19 (Fri, 19 Mar 2021)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-bswap.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-ctlz.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-cttz.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-fp-buildvec.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-buildvec.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int.ll

  Log Message:
  -----------
  [RISCV] Maintain fixed-length info when optimizing BUILD_VECTORs

I'm not sure how I failed to notice this before, but when optimizing
dominant-element BUILD_VECTORs we would lower via the scalable container type,
which lost us the information about the fixed length of the vector types. By
lowering via the fixed-length type we can preserve that information and
eliminate redundant vsetvli instructions.

Reviewed By: craig.topper

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




More information about the All-commits mailing list