Add support for running the regalloc2 checker. (#4043)
With these fixes, all this PR has to do is instantiate and run the checker on the `regalloc2::Output`. This is off by default, and is enabled by setting the `regalloc_checker` Cranelift option. This restores the old functionality provided by e.g. the `backtracking_checked` regalloc algorithm setting rather than `backtracking` when we were still on regalloc.rs.
This commit is contained in:
@@ -3,6 +3,21 @@ use crate::cdsl::settings::{SettingGroup, SettingGroupBuilder};
|
||||
pub(crate) fn define() -> SettingGroup {
|
||||
let mut settings = SettingGroupBuilder::new("shared");
|
||||
|
||||
settings.add_bool(
|
||||
"regalloc_checker",
|
||||
"Enable the symbolic checker for register allocation.",
|
||||
r#"
|
||||
This performs a verification that the register allocator preserves
|
||||
equivalent dataflow with respect to the original (pre-regalloc)
|
||||
program. This analysis is somewhat expensive. However, if it succeeds,
|
||||
it provides independent evidence (by a carefully-reviewed, from-first-principles
|
||||
analysis) that no regalloc bugs were triggered for the particular compilations
|
||||
performed. This is a valuable assurance to have as regalloc bugs can be
|
||||
very dangerous and difficult to debug.
|
||||
"#,
|
||||
false,
|
||||
);
|
||||
|
||||
settings.add_enum(
|
||||
"opt_level",
|
||||
"Optimization level for generated code.",
|
||||
|
||||
Reference in New Issue
Block a user