Right now ComputeFullInlineCost is always true because it is set to be true if ORE is non-null. However ORE is never null for inliner. Whether we will emit optimization remark for inliner doesn't depend on it. This introduces the problem that during getInlineCost we cannot return early even if we already know the cost is definitely higher than the threshold. It is a general problem for compile time.
For now, we simply remove ORE check when we initialize ComputeFullInlineCost. That will solve the compile time problem. Although it will miss some extra information in the optimization remark report, currently we don't have a clean way to check whether optimization remark are enabled for either inline or inline-cost passes. If the missing information is a problem, explicitly adding -mllvm -inline-cost-full will solve that.