This patch changes the following TargetTransformInfo and BasicTTIIMpl
interfaces to return a InstructionCost class:
getUserCost getInstructionLatency getInstructionThroughput
As a result of changing getUserCost I have also had to fix up various
places where it is called. In places where it's obvious that we should
never encounter an invalid cost I have added an assert and dereferenced
the value. In other places where trivial I have simply added isValid()
checks and bailed out of an optimisation.
See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html
Where are all of these "return -1"'s handled?