[PATCH] D63007: [RISCV] Add RISCV-specific TargetTransformInfo

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 01:16:31 PDT 2019


lenary marked an inline comment as done.
lenary added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:17
+
+int RISCVTTIImpl::getIntImmCost(int64_t Val) {
+  if (Val == 0)
----------------
asb wrote:
> Don't you want to implement this in terms of getIntMatCost, as you introduced in D62857?
I felt that was:
- less clear;
- less easy to customise, for other LLVM IR instructions with constant arguments that might mean other things; and
- obscured the fact that `getIntImmCost` is an estimate, where the code that uses the result has fairly specific "thresholds" that trigger optimisation behaviour.

I felt these three points outweighed the abstraction benefits of calling `getIntMatCost`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63007





More information about the llvm-commits mailing list