llvm-project
3d126bd5 - [CostModel] Move the arbitrary load latency into getMemoryOpCost (#198790)

Commit
59 days ago
[CostModel] Move the arbitrary load latency into getMemoryOpCost (#198790) Currently TargetTransformInfoImpl returns an arbitrary cost of 4 for the latency of loads in getInstructionCost. This means even if a target correctly reports the latency for loads in getMemoryOpCost we still get this arbitrary cost in getInstructionCost. It also means the latency cost is inconsistent depending on whether you go through getInstructionCost or getMemoryOpCost. Solve this by moving the current arbitrary cost into getMemoryOpCost. This has the side-effect of affecting the cost of masked loads if they aren't handled by the target, as in BasicTTIImpl the cost for these is calculated using getMemoryOpCost. This should mean the cost is more accurate though, and likely won't have any effect as in any transformation that could introduce masked loads (e.g. vectorization) the current cost is probably high enough that it's already not worth using.
Parents
Loading