[all-commits] [llvm/llvm-project] 02dd4b: [RISCV] Optimize floating-point "dominant value" B...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Thu Jul 29 01:31:51 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 02dd4b59bc0d34ecd41fcc314f5571572b3feebc
      https://github.com/llvm/llvm-project/commit/02dd4b59bc0d34ecd41fcc314f5571572b3feebc
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-07-29 (Thu, 29 Jul 2021)

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

  Log Message:
  -----------
  [RISCV] Optimize floating-point "dominant value" BUILD_VECTORs

This patch aims to improve the performance of BUILD_VECTORs which are
identified as containing a dominant element. Given that most
floating-point constants themselves require a load from the constant
pool, it was possible for the optimization to actually increase the
number of individual loads on small vectors. The exception is the zero
constant -- +0.0 -- which can be materialized efficiently.

While this optimization could do with a proper cost model to weigh the
benfits of a single vector load vs. the manipulation of individual
elements -- even for integer vectors which often require several
instructions to materialize -- without a concrete RVV implementation to
work with any heuristic is likely to be both more obtuse and inaccurate.

Until then, this patch fixes at least one known obvious deficiency.

Reviewed By: craig.topper

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




More information about the All-commits mailing list