From 3e65115cef8dec7d280784fdd7324ede529051be Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Thu, 19 Oct 2023 15:29:31 -0400 Subject: [PATCH] YJIT: remove unused `--yjit-greedy-versioning` command-line option (#8713) --- doc/yjit/yjit.md | 3 +-- yjit/src/core.rs | 8 -------- yjit/src/options.rs | 8 +------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/doc/yjit/yjit.md b/doc/yjit/yjit.md index 4c1984ca6b..7e2472b76e 100644 --- a/doc/yjit/yjit.md +++ b/doc/yjit/yjit.md @@ -172,8 +172,7 @@ compiled, lower values mean less code is compiled (default 200000) - `--yjit-stats=quiet`: gather statistics while running a program but don't print them. Stats are accessible through `RubyVM::YJIT.runtime_stats`. (incurs a run-time cost) - `--yjit-trace-exits`: produce a Marshal dump of backtraces from specific exits. Automatically enables `--yjit-stats` - `--yjit-max-versions=N`: maximum number of versions to generate per basic block (default 4) -- `--yjit-greedy-versioning`: greedy versioning mode (disabled by default, may increase code size) -- `--yjit-perf`: Enable frame pointers and perf profiling +- `--yjit-perf`: Enable frame pointers and profiling with the `perf` tool Note that there is also an environment variable `RUBY_YJIT_ENABLE` which can be used to enable YJIT. This can be useful for some deployment scripts where specifying an extra command-line option to Ruby is not practical. diff --git a/yjit/src/core.rs b/yjit/src/core.rs index b75b809d26..e58475a3aa 100644 --- a/yjit/src/core.rs +++ b/yjit/src/core.rs @@ -1393,14 +1393,6 @@ fn find_block_version(blockid: BlockId, ctx: &Context) -> Option { } } - // If greedy versioning is enabled - if get_option!(greedy_versioning) { - // If we're below the version limit, don't settle for an imperfect match - if versions.len() + 1 < get_option!(max_versions) && best_diff > 0 { - return None; - } - } - return best_version; } diff --git a/yjit/src/options.rs b/yjit/src/options.rs index c4f3e8df3a..fe0a7ec9cc 100644 --- a/yjit/src/options.rs +++ b/yjit/src/options.rs @@ -22,9 +22,6 @@ pub struct Options { // Note that the command line argument is expressed in MiB and not bytes pub exec_mem_size: usize, - // Generate versions greedily until the limit is hit - pub greedy_versioning: bool, - // Disable the propagation of type information pub no_type_prop: bool, @@ -73,7 +70,6 @@ pub struct Options { // Initialize the options to default values pub static mut OPTIONS: Options = Options { exec_mem_size: 128 * 1024 * 1024, - greedy_versioning: false, no_type_prop: false, max_versions: 4, num_temp_regs: 5, @@ -91,7 +87,7 @@ pub static mut OPTIONS: Options = Options { }; /// YJIT option descriptions for `ruby --help`. -static YJIT_OPTIONS: [(&str, &str); 9] = [ +static YJIT_OPTIONS: [(&str, &str); 8] = [ ("--yjit-stats", "Enable collecting YJIT statistics"), ("--yjit-trace-exits", "Record Ruby source location when exiting from generated code"), ("--yjit-trace-exits-sample-rate", "Trace exit locations only every Nth occurrence"), @@ -99,7 +95,6 @@ static YJIT_OPTIONS: [(&str, &str); 9] = [ ("--yjit-call-threshold=num", "Number of calls to trigger JIT (default: 30)"), ("--yjit-cold-threshold=num", "Global call after which ISEQs not compiled (default: 200K)"), ("--yjit-max-versions=num", "Maximum number of versions per basic block (default: 4)"), - ("--yjit-greedy-versioning", "Greedy versioning mode (default: disabled)"), ("--yjit-perf", "Enable frame pointers and perf profiling"), ]; @@ -224,7 +219,6 @@ pub fn parse_option(str_ptr: *const std::os::raw::c_char) -> Option<()> { OPTIONS.dump_iseq_disasm = Some(opt_val.to_string()); }, - ("greedy-versioning", "") => unsafe { OPTIONS.greedy_versioning = true }, ("no-type-prop", "") => unsafe { OPTIONS.no_type_prop = true }, ("stats", _) => match opt_val { "" => unsafe { OPTIONS.gen_stats = true },