Skip to content

Order LLVM IR functions to ensure proper bytecode layout #778

Open
@PavelKopyl

Description

@PavelKopyl

The order of LLVM IR functions in Module matters. The first function in the layout should be the one that contains initialization stuff. At least this includes:

  • receiving messages and dispatching them according to ABI
  • setting up the free heap ptr

As a possible solution, FE could add an "init" attribute to that function and LLVM will ensure it comes first in the module layout.
The reason why everything seems to work fine at the moment, is -O2/O3 optimization levels which turn on aggressive inlining.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions