[PATCH] D61282: [InlineCost] Check if caller formulates indirect recursion.

Taewook Oh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 15:55:17 PDT 2019


twoh marked an inline comment as done.
twoh added inline comments.


================
Comment at: llvm/test/Transforms/Inline/recursive.ll:70
+; CHECK-INDIRECT: call i32 @large_stack_indirect_recursive_caller
+  %f = call i32 @large_stack_callee(i32 %r)
+; CHECK-INDIRECT: call i32 @large_stack_callee
----------------
lebedev.ri wrote:
> Can you also add a test to show what happens if `@large_stack_callee` is not called?
> It should then be inlined?
> Or is the intention to completely prohibit inlining of recursive calls?
No https://github.com/llvm-mirror/llvm/blob/master/lib/Analysis/InlineCost.cpp#L1607 is the only place where `IsCallerRecursive` is effective, so it only matters when `AllocatedSize > InlineConstants::TotalAllocaSizeRecursiveCaller`. 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61282/new/

https://reviews.llvm.org/D61282





More information about the llvm-commits mailing list