How to allocate redundant stack slot?

Hi all,

Sorry to bother those not interested. I am a newbie to LLVM.
I have a problem on allocating additional stack slot for checkpointing.
However, I have no idea on how to allocate redundant stack slot in llvm.

Any suggestions?

Thanks,
Ray

Hi Ray,

Sorry to bother those not interested. I am a newbie to LLVM.
I have a problem on allocating additional stack slot for checkpointing.
However, I have no idea on how to allocate redundant stack slot in llvm.

It's a little difficult to tell what you're trying to do. Do you want
functions to allocate some space on the stack for an external routine
to use, but that'll be otherwise completely ignored by LLVM?

If so, it's probably a matter for XYZFrameLowering to handle (unused
allocas in the IR can be removed at will, and I can't think of a
better place to put it). The key function to call is probably
"CreateStackObject", probably from
"processFunctionBeforeCalleeSavedScan".

If you want LLVM code to actually interact with this stack slot, the
answer may or may not change, of course. But I don't think anyone can
answer properly without knowing more details.

Cheers.

Tim.

You’re use of the term “checkpointing” caught my eye. Are you trying to do something GC related?

Philip

Hi Philip,

I am sorry. It has nothing to do with GC. All I need is some stack slots that can
checkpoint some register values to there. However, I am not sure how to do that
correctly. Tim’s idea inspire me a lot. I just wonder whether there is any way to
make it easier.
Thanks.

Ray

Hi Ray,

PEI does something kinda like this for emergency spill slots, which are used by the register scavenger. You may find looking through how that works useful as a rough guide to what’s involved.

-Jim