[llvm-commits] [llvm] r61969 - in /llvm/trunk: include/llvm/Transforms/IPO/InlinerPass.h include/llvm/Transforms/Utils/InlineCost.h lib/Transforms/IPO/InlineAlways.cpp lib/Transforms/IPO/InlineSimple.cpp lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineCost.cpp

Duncan Sands baldrick at free.fr
Fri Jan 9 01:03:32 PST 2009


Hi Dale,

> +    // Don't inline a callee with dynamic alloca into a caller without them.
> +    // Functions containing dynamic alloca's are inefficient in various ways;

would they be less inefficient if codegen output all fixed size allocas before
any variable sized alloca's?  Then all fixed size allocas will be at a constant
offset from the frame pointer.  If there is no frame pointer then I guess it
should be inverted: dynamic allocas first, then fixed size ones, so the fixed
size allocas are at a constant offset from the stack pointer.  But perhaps
there are other inefficiencies beyond having to compute the addresses of
stack variables?

Ciao,

Duncan.

PS: Ada uses plenty of variable sized allocas.  So I'm interested in minimizing
the impact of them.  Also, rather than tweaking the inliner like this, mightn't
be better to reduce the impact of using variable sized allocas to the point where
inlining them is acceptable?



More information about the llvm-commits mailing list