nalmt opened PR #1397 from pathological_case_951
to master
:
To fix this case (#951) that may take forever to compile:
function %a(){ ebb477777777: }We decide to define a maximum threshold for the number of blocks in functions.
Based on a large WASM program (https://github.com/mozilla/perf-automation/blob/master/benchmarks/wasm-misc/AngryBots.wasm),
its IR functions does not exceed 1414 blocks. A number 100 times greater (100,000 blocks) seems (currently) enough to define our maximum threshold.To make this quick benchmark the cranelift-wasm/src/func_translator.rs file has been modified like this:
static mut MAX: usize = 0; pub fn translate_from_reader<FE: FuncEnvironment + ?Sized>(...) { [...] builder.finalize(); // the compiler is single threaded unsafe { if func.dfg.num_ebbs() > MAX { MAX = func.dfg.num_ebbs(); println!("MAX {}", MAX); } } Ok(()) }
bjorn3 submitted PR Review.
bjorn3 submitted PR Review.
bjorn3 created PR Review Comment:
const MAX_BLOCKS_IN_A_FUNCTION: u32 = 100_000;
nalmt updated PR #1397 from pathological_case_951
to master
:
To fix this case (#951) that may take forever to compile:
function %a(){ ebb477777777: }We decide to define a maximum threshold for the number of blocks in functions.
Based on a large WASM program (https://github.com/mozilla/perf-automation/blob/master/benchmarks/wasm-misc/AngryBots.wasm),
its IR functions does not exceed 1414 blocks. A number 100 times greater (100,000 blocks) seems (currently) enough to define our maximum threshold.To make this quick benchmark the cranelift-wasm/src/func_translator.rs file has been modified like this:
static mut MAX: usize = 0; pub fn translate_from_reader<FE: FuncEnvironment + ?Sized>(...) { [...] builder.finalize(); // the compiler is single threaded unsafe { if func.dfg.num_ebbs() > MAX { MAX = func.dfg.num_ebbs(); println!("MAX {}", MAX); } } Ok(()) }
nalmt updated PR #1397 from pathological_case_951
to master
:
To fix this case (#951) that may take forever to compile:
function %a(){ ebb477777777: }We decide to define a maximum threshold for the number of blocks in functions.
Based on a large WASM program (https://github.com/mozilla/perf-automation/blob/master/benchmarks/wasm-misc/AngryBots.wasm),
its IR functions does not exceed 1414 blocks. A number 100 times greater (100,000 blocks) seems (currently) enough to define our maximum threshold.To make this quick benchmark the cranelift-wasm/src/func_translator.rs file has been modified like this:
static mut MAX: usize = 0; pub fn translate_from_reader<FE: FuncEnvironment + ?Sized>(...) { [...] builder.finalize(); // the compiler is single threaded unsafe { if func.dfg.num_ebbs() > MAX { MAX = func.dfg.num_ebbs(); println!("MAX {}", MAX); } } Ok(()) }
bnjbvr requested bnjbvr for a review on PR #1397.
bnjbvr submitted PR Review.
bnjbvr created PR Review Comment:
nit: since block numbers start at 0, there's an off-by-one here, and it will accept 100,000 blocks, but not 100,001, which is why the test had to contain the latter number. Can you use ">=" here instead, please?
bnjbvr submitted PR Review.
bnjbvr created PR Review Comment:
(and then you can adjust this number to be 100000.)
nalmt updated PR #1397 from pathological_case_951
to master
:
To fix this case (#951) that may take forever to compile:
function %a(){ ebb477777777: }We decide to define a maximum threshold for the number of blocks in functions.
Based on a large WASM program (https://github.com/mozilla/perf-automation/blob/master/benchmarks/wasm-misc/AngryBots.wasm),
its IR functions does not exceed 1414 blocks. A number 100 times greater (100,000 blocks) seems (currently) enough to define our maximum threshold.To make this quick benchmark the cranelift-wasm/src/func_translator.rs file has been modified like this:
static mut MAX: usize = 0; pub fn translate_from_reader<FE: FuncEnvironment + ?Sized>(...) { [...] builder.finalize(); // the compiler is single threaded unsafe { if func.dfg.num_ebbs() > MAX { MAX = func.dfg.num_ebbs(); println!("MAX {}", MAX); } } Ok(()) }
nalmt updated PR #1397 from pathological_case_951
to master
:
To fix this case (#951) that may take forever to compile:
function %a(){ ebb477777777: }We decide to define a maximum threshold for the number of blocks in functions.
Based on a large WASM program (https://github.com/mozilla/perf-automation/blob/master/benchmarks/wasm-misc/AngryBots.wasm),
its IR functions does not exceed 1414 blocks. A number 100 times greater (100,000 blocks) seems (currently) enough to define our maximum threshold.To make this quick benchmark the cranelift-wasm/src/func_translator.rs file has been modified like this:
static mut MAX: usize = 0; pub fn translate_from_reader<FE: FuncEnvironment + ?Sized>(...) { [...] builder.finalize(); // the compiler is single threaded unsafe { if func.dfg.num_ebbs() > MAX { MAX = func.dfg.num_ebbs(); println!("MAX {}", MAX); } } Ok(()) }
nalmt requested bnjbvr for a review on PR #1397.
bnjbvr submitted PR Review.
bnjbvr merged PR #1397.
Last updated: Nov 22 2024 at 16:03 UTC