getCallCost is only used within the different layers of TTI, with no backend implementing it, so fold the base implementation into getUserCost. I think this is an NFC.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
It would be great if we can simplify this chunk, but I'm not sure of the history/plans. Adding @SjoerdMeijer based on the recent patch D59014.
This is a tricky one, because usually it is quite simpel: if code is not used, it should be deleted. However, estimating costs of e.g. libc functions is such a glaring omission, something we definitely should be doing, but we aren't very unfortunately. I had to switch tasks before I could finish D59129, but that is just one example how we could estimate costs.... So yeah, I don't know, if this is really bothering you, we can get rid of rid, but perhaps keeping this infrastructure isn't that bad?
Perhaps this is also a good motivation to pick up D59129 again on the side...
From what I can see from that patch, it's concerned with the cost of intrinsics only? It seems that the cost of intrinsics has been the only important thing to be used by TTI in general, and removing getCallCost shouldn't interfere with that. This patch still passes the User to getIntrinsicCost.
LGTM - we're trying to reduce and fix the cost model mess, so I'm fine with this step. If we want to add non-intrinsic call cost modeling in the future, it can be done without much effort when necessary.
llvm/include/llvm/Analysis/TargetTransformInfoImpl.h | ||
---|---|---|
865 | Copy over the existing code comment to explain this? // The target-independent implementation just measures the size of the // function by approximating that each argument will take on average one // instruction to prepare. |
Ah yes, it's getCallCost calling getIntrinsicCost, and this is about getCallCost, so agreed.
Copy over the existing code comment to explain this?