[LLVMdev] repeated recursion with "frozen" arguments

Valery A.Khamenya khamenya at mail.ru
Wed Aug 27 12:42:01 PDT 2003


Hello Chris,

Wednesday, August 27, 2003, 4:27:21 PM, you wrote:

CL> Ok, Vikram is right.  This is known as procedure cloning, where the
CL> compiler makes a specialized version of the function for an invocation
CL> with constant arguments (thus making it so you don't have to pass the
CL> arguments).

just one remark: it would be better to say "known arguments" instead
of "constant arguments" :)

CL> Ok, I see why I was confused here.  The problem is that a particular
CL> "this" is not, in general, a compile time constant: if the object is
CL> allocated dynamically on the stack or heap, the static compiler doesn't
CL> know which value to specialize with.  Obviously a dynamic compiler could
CL> though...

exactly :)

CL> Ok, I understand now.  When I think of lexical closures, I think if a
CL> piece of memory which holds the variables used by a block of code, coupled
CL> with a generic version of the code.  Converting a "this" pointer to use
CL> this style of closure means that you have to add a closure pointer  :)

:)

CL> So, in sum, yes, LLVM is a good representation to do this kind of thing
CL> on.  :)

is LLVM a kind of paradise promises?..
I should definitely check this out :)

-- 
Best regards,
Valery A.Khamenya                       mailto:khamenya at mail.ru
Local Time: 19:36




More information about the llvm-dev mailing list