hi,
I don't understand exactlly the difference among main function, prologue code, and call function.
how the llvm JIT process them in details?
the main function is a program start entry
prologue code
call
yueqiang
2003/12/25
hi,
I don't understand exactlly the difference among main function, prologue code, and call function.
how the llvm JIT process them in details?
the main function is a program start entry
prologue code
call
yueqiang
2003/12/25
I don't understand exactlly the difference among main function, prologue
code, and call function.
I'm not sure that I understand your question. LLVM abstracts away
target-specific information like function prologs and epilogs.
If you are curious about the typical arrangement used by unix systems with
_start and main, LLVM does not have that. Basically it uses 'main' as the
entry point to the program, allowing the system specific _start to set up
the system specific stuff it has to in a normal system, without llvm
having to know about it. This is typically pulled in from the native libc
or crt0.o.
how the llvm JIT process them in details?
the main function is a program start entry
To start a program, the JIT code generates the main function, then jumps
to it to start execution.
prologue code
call
I'm not sure exactly what you mean here...
-Chris
Chris Lattner wrote:
I don't understand exactlly the difference among main function, prologue
code, and call function.
I'm not sure that I understand your question. LLVM abstracts away
target-specific information like function prologs and epilogs.If you are curious about the typical arrangement used by unix systems with
_start and main, LLVM does not have that. Basically it uses 'main' as the
entry point to the program, allowing the system specific _start to set up
the system specific stuff it has to in a normal system, without llvm
having to know about it. This is typically pulled in from the native libc
or crt0.o.
libc or crt0.o
in linux which one used by llvm system?
how the llvm JIT process them in details?
the main function is a program start entry
To start a program, the JIT code generates the main function, then jumps
to it to start execution.prologue code
call
in llvm call is an instruction.
I want to know when execute callee function, how the caller saves registers or stack?
such as x86 call instruction.
libc or crt0.o
in linux which one used by llvm system?
The JIT uses neither. LLC (the static compiler) uses whatever the native
C compiler uses.
>>prologue code
>>call
in llvm call is an instruction. I want to know when execute callee
function, how the caller saves registers or stack? such as x86 call
instruction.
LLVM matches the native calling conventions, so on X86 this means that it
pushes the arguments onto the program stack in reverse order, then
executes a call. You can find out more about X86 specific details from
many other places.
-Chris