[LLVMdev] Representing a safepoint as an instruction in the x86 backend?

Andrew Trick atrick at apple.com
Thu Feb 27 14:42:22 PST 2014


On Feb 27, 2014, at 1:08 PM, Juergen Ributzka <juergen at apple.com> wrote:

> wouldn’t it be easier to adapt the patchpoint intrinsic to allow it to take also a function address/global address as target argument. We are already tapping into the target-specific call lowering, so the call would be lowered exactly the same way. By doing this you don’t have to worry about anything getting inserted between your CALL and SAFEPOINT instruction. I know the GLUE flag is supposed to keep things together in the call sequence, but I think it is very fragile to rely on this.


GLUE is only for keeping things together during ISEL because SelectionDAG does not represent dependencies on named resources like physical registers.

Juergen is right about using patchpoint. Part of the reason that we have two intrinsics, stackmap and patchpoint[1], is that patchpoint allows you to embed a call instruction. A pseudo instruction is the only way to “glue” operations through the entire code generator (let’s ignore MachineBundles for now).

We always meant to have patchpoint take a function address. I think there are just a few FIXMEs to take care of to make it work.

-Andy

[1] I would really prefer to have only one patchpoint intrinsic that can be used for stack maps too, but the semantics for reserving encoding space don’t quite match up.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140227/aa14b346/attachment.html>


More information about the llvm-dev mailing list