Skip to content

Add a cranelift flag to enable/disable verbose logs for regalloc2#4481

Merged
cfallin merged 1 commit intobytecodealliance:mainfrom
bnjbvr:regalloc-verbose-logs-flag
Jul 21, 2022
Merged

Add a cranelift flag to enable/disable verbose logs for regalloc2#4481
cfallin merged 1 commit intobytecodealliance:mainfrom
bnjbvr:regalloc-verbose-logs-flag

Conversation

@bnjbvr
Copy link
Copy Markdown
Member

@bnjbvr bnjbvr commented Jul 20, 2022

Instead of relying on the log_enabled check to decide whether to enable regalloc2 verbose logs, I propose to use an explicit Cranelift flag to do that, as it's more explicit and allows downstream users to use the log::trace!() level without suffering from a big performance penalty.

The flag is disabled by default, because I assume this is only useful when debugging regalloc2 or understanding the decisions it took during register allocation.

As a matter of fact, in our embedding where we enable the Trace level to get all logs (and filter them selectively in some tracing subscribers), this is a 32% compile time speedup when compiling a large module in parallel on my machine.

@cfallin
Copy link
Copy Markdown
Member

cfallin commented Jul 20, 2022

This sounds reasonable to me!

@cfallin cfallin enabled auto-merge (squash) July 20, 2022 17:27
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:meta Everything related to the meta-language. wasmtime:api Related to the API of the `wasmtime` crate itself labels Jul 20, 2022
@github-actions
Copy link
Copy Markdown

Subscribe to Label Action

cc @peterhuene

Details This issue or pull request has been labeled: "cranelift", "cranelift:area:machinst", "cranelift:meta", "wasmtime:api"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@alexcrichton
Copy link
Copy Markdown
Member

Apologies for the CI breakage, but things should be fixed with a rebase.

@bnjbvr bnjbvr force-pushed the regalloc-verbose-logs-flag branch from 553bb61 to 1698431 Compare July 21, 2022 08:13
@cfallin cfallin merged commit 4ce329d into bytecodealliance:main Jul 21, 2022
@bnjbvr bnjbvr deleted the regalloc-verbose-logs-flag branch July 21, 2022 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:meta Everything related to the meta-language. cranelift Issues related to the Cranelift code generator wasmtime:api Related to the API of the `wasmtime` crate itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants