[LLVMdev] A couple questions

Brian R. Gaeke gaeke at uiuc.edu
Fri Dec 5 12:31:02 PST 2003


> Question 1:
> I am trying to get a function not to be inlined.
>[...]
> gcc 3.2.2 does not inline this by default.  Also, on 
> llvm.cs.uiuc.edu/demo, the compiler does not inline the function.  
> However, on my version of the compiler, the function print_string is 
> inlined by default.

As John pointed out, it's the optimizing linker (gccld) that is doing the
inlining. All I have to add is, if you want to see this on the demo page,
you have to check the box for "run link-time optimizer".
 
> Question 2:
> 
> What is the behavior of the function "recompileAndRelinkFunction" (in 
> VM.{h,cpp}) if a program running in lli is currently executing within 
> the function that is being recompiled?

If you're currently running within a function that you call
recompileAndRelinkFunction() on, what I expect will happen is: further
invocations of that function will be modified, but any invocations
currently running will not be modified.  It's currently implemented by
writing a branch at the beginning of the function's old native machine code to
its new native machine code (i.e., overwriting the beginning of its entry
basic block.)

Let us know if you have further questions.

Hope this helps,
-Brian

-- 
gaeke at uiuc.edu



More information about the llvm-dev mailing list