Page MenuHomePhabricator

[X86] Extract HiPE prologue constants into metadata

Authored by margnus1 on May 18 2016, 6:16 AM.



X86FrameLowering::adjustForHiPEPrologue() contains a hard-coded offset
into an Erlang Runtime System-internal data structure (the PCB). As the
layout of this data structure is prone to change, this poses problems
for maintaining compatibility.

To address this problem, we will have the compiler spit out this
information as module-level named metadata. For example (where
P_NSP_LIMIT is the offending offset):

!hipe.literals = !{ !2, !3, !4 }
!2 = !{ !"P_NSP_LIMIT", i32 152 }
!3 = !{ !"X86_LEAF_WORDS", i32 24 }
!4 = !{ !"AMD64_LEAF_WORDS", i32 24 }

Diff Detail


Event Timeline

margnus1 updated this revision to Diff 57602.May 18 2016, 6:16 AM
margnus1 retitled this revision from to [X86] Extract HiPE prologue constants into metadata.
margnus1 updated this object.
margnus1 added reviewers: bkramer, nadav.
margnus1 added a subscriber: llvm-commits.

Ping. Oh, and the corresponding code for HiPE is currently being reviewed at Erlang/OTP's Github:

kostis added a subscriber: kostis.Jun 20 2016, 4:11 AM

We would appreciate some action on this one from the responsible reviewers...

nadav edited edge metadata.Jun 20 2016, 1:34 PM

Magnus, I don't have any problem with this change because it is specific to Erlang. I suggest CC-ing the original author of adjustForHiPEPrologue, and if that person has no objections commit the change. Relying on metadata is not idea, but I understand the constraint.

It's totally fine; actually, it's even better than hard-coding those Erlang VM-specific values in the LLVM code. Thanks for working on this Magnus! :)


Excellent. I would appriciate if a reviewer could commit this for me, since I lack commit access.

This revision was automatically updated to reflect the committed changes.