[PATCH] D20603: [Inline] Add ability to restrict inlining pass to hinted functions only

Easwaran Raman via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 14:28:44 PDT 2016

eraman added a comment.

I'll defer to Chandler on this patch. I have some minor comments and some questions. Is there a practical use case for this or is this more for debugging purposes? Is there a reason why one would want to prevent inlining of, say, a static function with only one callsite that is not marked inline? If it is for debugging/tuning purposes, as you indicate above, using a large negative value for inline-threshold flag will get the job done.

Comment at: include/llvm/Transforms/IPO.h:104
@@ +103,3 @@
+/// The OnlyHint flag allow to restric inlining analysis to function with
+/// InlineHint attribute.
Nit: restric -> restrict

Comment at: test/Transforms/Inline/inline-hint.ll:28
@@ +27,3 @@
+; INLINE-NOT: call i32 @simpleFunction
I typically specify the checks next to the actual statements (for example, place the above label check next to bar's definition) and I typically see that in all the test cases. I don't know if that is the enforced style, but it does make the test cases more readable. 


More information about the llvm-commits mailing list