[LLVMdev] [llvm]/lib/CodeGen/PrologEpilogInserter.cpp RestoreCSRegs before epilogue, why?

Anton Korobeynikov anton at korobeynikov.info
Fri Jul 18 04:56:02 PDT 2014


> Why we don't use directly:
> insertCSRSpiil
> insertProlog
> insertEpilog
> InsertCSRRestore

Because the world is not that simple. In particular, if you will real
MSP430FrameLowering::emitEpilogue function, you will see that it needs
to insert stuff both *before* and *after* the callee-saved spill /
restore code. In particular, we need to start to set up frame just at
the start of the function, then integrate the callee-saved spill code
as a normal frame setup and continue afterwards.

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-dev mailing list