[LLVMdev] Saving registers used by function

Vladimir Prus ghost at cs.msu.su
Wed Jun 9 07:15:01 PDT 2004


Alkis Evlogimenos wrote:

> > Actually, about callee saved registers. The naive compiler pushes/pop all
> > registers which are used in a function and must be preserved.
>
> You should define these as they are defined in the X86 and PowerPC
> backends:
>
> def X86 : Target {
>   // Specify the callee saved registers.
>   let CalleeSavedRegisters = [ESI, EDI, EBX, EBP];
>
> PrologueEpilogue inserter will then add store/loads to each register in
> this list that is modified.

Thanks, this does work!

- Volodya




More information about the llvm-dev mailing list