Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Temporarily disable sorting of function symbols by debug info. Emit function symbols in topological order.
Currently, the layout of function symbols is determined by their debug info, so that functions in the final assembly file appear in the same order as in the source file. This is convenient for debugging and stable layout. However, it can makes some backend passes overly conservative. Currently, this affects only
checkmach
andpolling
that rely on "future" function names. For example,zero_alloc
check fails on a common code patternraise_s [%message ...]
.results in the following code after ppx :
and
raise_invalid_index
is emitted beforeppx_sexp_message
even though they are not mutually recursive.A proper fix is more involved. The backend translates functions in layout order, fully translating each function from
Cmm
all the way toassembly
before moving on to the next function. We can change the backend to translate the functions in topological order and then emit them in source order. This means holding on toMach.fundecl
longer and careful handling any mutable state. Separately, an improvenent to zero_alloc analysis to handle mutually recursive functions will also fix this.