[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
Dale Johannesen
dalej at apple.com
Fri Jan 9 09:48:20 PST 2009
On Jan 9, 2009, at 1:03 AMPST, Duncan Sands wrote:
> 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?
Calls that push parameters on the stack have to decrement the stack
pointer
dynamically instead of allocating a fixed-offset parameter area in the
prolog.
This is very noticeable on x86-32.
> 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