[llvm] [RISCV][CostModel][NFC] Add getRISCVInstructionCost() to TTI for Cost… (PR #73651)

Shih-Po Hung via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 28 22:55:44 PST 2023


arcbbb wrote:

> What's the actual problem you're hoping to solve here? Where are you going with this direction?
@preames 
Two problem I would like to solve in this way:

1. Centralization of instruction cost updates:
  The primary goal is to simplify the process of modifying these costs.
For example, consider the case of instructions like "VSLIDE" and "VMERGE". Introducing vendor-specific cost updates for these instructions currently requires extensive modifications scattered throughout the code
2. Improve the way costs are computed for TCK_CodeSize, TCK_Latency, and TCK_RecipThroughput.
For the VMV_VX instruction, the cost calculations are differentiated based on the cost metric type: 
it's set to 1 for TCK_CodeSize, scales with LMULCost for TCK_Latency, and could potentially be calculated as `DIV(LMULCost, NumUnit)` for TCK_RecipThroughput. 

And in this way I would like to update TTI cost functions of shuffle, cast, reduction, and arithmetic instruction in follow-up patches.

https://github.com/llvm/llvm-project/pull/73651


More information about the llvm-commits mailing list