Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit low-level location information for FDO: use discriminators (2/2) #6

Merged
merged 7 commits into from
Mar 22, 2021

Conversation

gretay-js
Copy link
Contributor

Use discriminator field of .loc directives for the extra debug info when building with FDO, instead of using line numbers in fabricated files. This means we can preserve the source locations (file and line and column) in FDO executables.

This PR is on top of #5 and addresses the second problem described in #5.

Some Linear instructions don't have any debug info associated with them, because the compiler's support for propagating debug info is incomplete. We need debug info on each Linear instruction to emit FDO locations as discriminators. Following the semantics of debug_line programs, ocamlfdo tool infers the missing debug info from the preceding debug info in the order of the original function layout.

To ensure that the inferred debug info does not affect backtraces, in comparison to a build without FDO, ocamlfdo writes the inferred debug info into [fdo] field of Linear.instruction instead of directly to [dbg] field. This way, the inferred debug info is only used for .loc directives when FDO is enabled.

backend/x86_gas.ml Outdated Show resolved Hide resolved
@mshinwell mshinwell merged commit 1605229 into ocaml-flambda:4.11 Mar 22, 2021
poechsel pushed a commit to poechsel/flambda-backend that referenced this pull request May 26, 2021
lukemaurer added a commit to lukemaurer/flambda-backend that referenced this pull request Oct 20, 2021
Coercions only apply to their own domains - that is, a coercion on
closures doesn't apply to pairs (which might contain, say, a closure
and an int). So we don't want to recurse into types in general when
applying coercions. Unfortunately, the situation with closures is
... complicated, as explained in comments.
ccasin added a commit to ccasin/flambda-backend that referenced this pull request Mar 12, 2023
5e7dfce331 Merge flambda-backend changes
9f7f2d24a7 Edit script for test merge
1ae71ce59d Review comments (ocaml-flambda#6)
1845365bd0 Layouts version 1
aba629478e Immediacy rework (ocaml-flambda#122)
cf4eeefb12 Add no-stack-allocation variant of some tests that print lambda (ocaml-flambda#133)
8f22438aa4 Fully switch over Jane Street Merlin support to `.local-*` (ocaml-flambda#136)
5482a8df7b Remove `Lev_module_definition` from lambda (ocaml-flambda#135)
261e016273 Change modular extensions to produce `AST_desc` types (ocaml-flambda#132)
0760c82c68 Disable module patterns in comprehensions (ocaml-flambda#131)
6acac8024b Add Ctype global state debug printers (ocaml-flambda#130)
bc32037f10 Enable support for Jane Street's internal Merlin configuration (ocaml-flambda#64)
d1a8d0311b Split out `Clflags.Extension` into a new file, `Language_extension` (ocaml-flambda#125)
435de6d38c Fix bootstrap and add legacy CI (ocaml-flambda#126)
7e5a626e4b Improve the API of language extensions to better support upstream compatibility (and also tooling) (ocaml-flambda#13)
c4e17b0b2a Replace var with local for faster mode checking (ocaml-flambda#53)
6d477d8ef1 Merge pull request ocaml-flambda#124 from riaqn/merge-backend
d7375333a1 minor fixes after merge
f1710d6dc4 Merge flambda-backend changes
cc18534f49 Just run make boostrap (ocaml-flambda#123)

git-subtree-dir: ocaml
git-subtree-split: 5e7dfce331d0e39c695fab9b00e3d2cda7d9ebb4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants