Skip to content

Commit 1d7ed95

Browse files
authored
ZJIT: Make --zjit-dump-hir work with HIR opt disabled (ruby#14242)
1 parent 2f2e2bd commit 1d7ed95

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

zjit/src/codegen.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,7 @@ fn compile_iseq(iseq: IseqPtr) -> Option<Function> {
13131313
if !get_option!(disable_hir_opt) {
13141314
function.optimize();
13151315
}
1316+
function.dump_hir();
13161317
#[cfg(debug_assertions)]
13171318
if let Err(err) = function.validate() {
13181319
debug!("ZJIT: compile_iseq: {err:?}");

zjit/src/hir.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,10 @@ impl Function {
21432143
#[cfg(debug_assertions)] self.assert_validates();
21442144
self.eliminate_dead_code();
21452145
#[cfg(debug_assertions)] self.assert_validates();
2146+
}
21462147

2148+
/// Dump HIR passed to codegen if specified by options.
2149+
pub fn dump_hir(&self) {
21472150
// Dump HIR after optimization
21482151
match get_option!(dump_hir_opt) {
21492152
Some(DumpHIR::WithoutSnapshot) => println!("Optimized HIR:\n{}", FunctionPrinter::without_snapshot(&self)),
@@ -2157,7 +2160,6 @@ impl Function {
21572160
}
21582161
}
21592162

2160-
21612163
/// Validates the following:
21622164
/// 1. Basic block jump args match parameter arity.
21632165
/// 2. Every terminator must be in the last position.

0 commit comments

Comments
 (0)