This is a test case for http://reviews.llvm.org/D14309 that uses the updated threshold for calculating indirect call bonus when baz->bar inlining would result in the indirect call passed to bar being resolved to foo.
To test the change, I needed the following properties:
- Cost of baz->bar (C1) is greater than the threshold (T1 = 115) without applying any indirect call bonus
- Let C2 be the cost of bar->foo inlining and T2 = InlineConstants::IndirectCallThreshold = 100). C1 > T1 + max(0, T2-C2), and
- C1 <= T1 + max(0, 1.5*T2 - C2). The 1.5 comes from the addition of single BB bonus. When considering bar->foo inlining, CostAnalyzer's getThreshold() will return 1.5*T2.
This looks very brittle to me. If IndirectCallThreshold and the single BB bonus were options to opt, then this would be much better, imo.
Please reduce the size of this function.
Also mark this function as hot such that T2 further boosted for the indirect callsite.