[PATCH] D36896: [TargetTransformInfo] Call target getMemoryOpCost for LoadInst from getUserCost

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 15:18:16 PDT 2017


Carrot added a comment.

In https://reviews.llvm.org/D36896#847686, @hfinkel wrote:

> We currently have two cost models in TTI. One is for the vectorizer and it is supposed to measure normalized reciprocal throughputs. The other model, the "user cost" model, is used by the inliner, the loop unroller, and a few other things. This model measures some less-well-defined combination of performance factors (thoughput/latency) and code size. I don't know whether tying these things together makes sense. At the risk of going down some rabbit hole, we should probably answer that question. If it does make sense, we should tie them together more completely than just for memory operations.


Thank you for the clarification that they are actually belong to two different cost models. 
My problem is in SimplifyCFG(if conversion), I want to compute the latency of a dependence chain. Currently I use getUserCost for each instruction, but I get 1 for memory load, it is much lower than reality, the big gap makes it almost useless. So which API should I use to get a more precise latency of instructions?


https://reviews.llvm.org/D36896





More information about the llvm-commits mailing list