[PATCH] D15356: Test case for indirect call bonus in inline cost analysis

David Li via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 16:02:45 PST 2016


davidxl added inline comments.

================
Comment at: test/Transforms/Inline/indirect-call-inlining-bonus.ll:9
@@ +8,3 @@
+
+define i32 @foo(i32 %val) {
+  %t1 = add i32 %val, 1
----------------
Please reduce the size of this function.

Also mark this function as hot such that T2 further boosted for the indirect callsite.

================
Comment at: test/Transforms/Inline/indirect-call-inlining-bonus.ll:43
@@ +42,3 @@
+
+define i32 @bar(i32 (i32)*, i32 %val) {
+  %t1 = add i32 %val, 1
----------------
Reduce the inline-threshold and size of the bar's body.

================
Comment at: test/Transforms/Inline/indirect-call-inlining-bonus.ll:87
@@ +86,3 @@
+  %res = call i32 @bar(i32 (i32)* @foo, i32 %val)
+  ret i32 %res
+}
----------------

Define another function foo_cold, and add another callsite to bar with foo_cold passed in.

Since for indirect call foo_cold the T2 won't be increased, the second callsite to bar is not inlined.




Repository:
  rL LLVM

http://reviews.llvm.org/D15356





More information about the llvm-commits mailing list