[PATCH] D42981: [COST] Fix cost model of load instructions on X86

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 13:23:22 PST 2018


ABataev added a comment.

In https://reviews.llvm.org/D42981#1001063, @spatel wrote:

> The patch is doing what I hoped for on PR36280, but I don't understand the reasoning.
>
> A folded load is not actually free on any x86 CPU AFAIK. It always has an extra uop, and that uop is handled on a different port / execution unit than the math op. The cost model that we're using here is based on throughput rates (let me know if I'm wrong), so I don't see how any load could be free.


This cost is already the part of the cost of the arithmetic instructions and we count this cost one more time when we try to estimate the cost of standalone load instructions.


Repository:
  rL LLVM

https://reviews.llvm.org/D42981





More information about the llvm-commits mailing list