Hi Anton, Anton Korobeynikov wrote:> I don't see any huge problems with writing such pass: just create > stack frame objects at fixed offsets inside your MF pass - and you'll > done. The only problem is that you need to do this early - before > prologue / epilogue inserter code runs, since afterwards stack frame > layout is almostly finalized (at "high level") and you'd deal with > much low-level and target-specific stuff. > >OK.> I believe you can even use on of prologue-epilogue inserter hooks in > order to do this... >Could you point me where those hooks are in the llvm code? I didn't find any. Thanks! Nicolas
Hi, Nicolas> Could you point me where those hooks are in the llvm code? I didn't find > any.Look into PrologEpilogInserter.cpp::PEI::runOnMachineFunction(). There are calls to hooks inside TargetRegisterInfo: TargetRegisterInfo::processFunctionBeforeCalleeSavedScan() and TargetRegisterInfo::processFunctionBeforeFrameFinalized(). Maybe they are not so convenient when working via JIT but at least you'll know the place, where all stack-related stuff is being cooked :) -- With best regards, Anton Korobeynikov Faculty of Mathematics and Mechanics, Saint Petersburg State University
Anton Korobeynikov wrote:> Hi, Nicolas > > >> Could you point me where those hooks are in the llvm code? I didn't find >> any. >> > Look into PrologEpilogInserter.cpp::PEI::runOnMachineFunction(). There > are calls to hooks inside TargetRegisterInfo: > TargetRegisterInfo::processFunctionBeforeCalleeSavedScan() and > TargetRegisterInfo::processFunctionBeforeFrameFinalized(). > >Doesn't that involve modifying the target? eg modifying X86RegisterInfo.cpp to allocate the stack entry?
Apparently Analagous Threads
- [LLVMdev] Controlling the stack layout
- Allowing virtual registers after register allocation
- [LLVMdev] What does this error mean: psuedo instructions should be removed before code emission?
- Allowing virtual registers after register allocation
- [LLVMdev] MSVC compile error with trunk