This patch changes the following TargetTransformInfo interfaces to
return a InstructionCost class:
As a result of changing getUserCost I have also had to fix up various
places where it is called. One example of this is in the CodeMetrics
class where the NumInsts field has been changed to InstructionCost.
If an invalid cost is encountered while analyzing a block we set the
notDuplicatable flag, and in addition certain places need to check
that NumInsts is valid.
In SimplifyCFG.cpp I have changed the code to ensure that we bail out
if trying to subtract an invalid cost.
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