There are several different types of cost that TTI tries to provide explicit information for: throughput, latency, code size along with a vague 'intersection of code-size cost and execution cost'.
The vectorizer is a keen user of RecipThroughput and there's at least 'getInstructionThroughput' and 'getArithmeticInstrCost' designed to help with this cost. The latency cost has a single use and a single implementation. The intersection cost appears to cover most of the rest of the API.
getUserCost is explicitly called from within TTI when the user has been explicit in wanting the code size (also only one use) as well as a few passes which are concerned with a mixture of size and/or a relative cost. In many cases these costs are closely related, such as when multiple instructions are required, but one evident diverging cost in this function is for div/rem.
This patch adds an argument so that the cost required is explicit, so that we can make the important distinction when necessary.
Next, I'd like to combine getUserCost and getInstructionCost.
Details
Diff Detail
Event Timeline
llvm/include/llvm/Analysis/TargetTransformInfo.h | ||
---|---|---|
157 | Would 'workingset' accurately describe what the 'hybrid' is used for, so a weighed sum of code and latency? I'm having trouble wrapping my mind around the old 'intersection' notion (what would intersecting 2 costs mean?), and 'hybrid', at a first glance, leads me to believe it's about combining all other 3. |
llvm/include/llvm/Analysis/TargetTransformInfo.h | ||
---|---|---|
157 | I also don't know what it means, I just quoted it from below :) and I agree that Hybrid is not descriptive. I would probably prefer to be as explicit as possible with something like SizeAndLatencyWeight. |
llvm/include/llvm/Analysis/TargetTransformInfo.h | ||
---|---|---|
157 | I think TCK_SizeAndLatency, with a descriptive comment, would probably communicate it clearly enough (and keep it reasonably concise) |
Would 'workingset' accurately describe what the 'hybrid' is used for, so a weighed sum of code and latency? I'm having trouble wrapping my mind around the old 'intersection' notion (what would intersecting 2 costs mean?), and 'hybrid', at a first glance, leads me to believe it's about combining all other 3.