Open
Description
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.