From 1548ca3c473a17ddae88b7ecb5216d1f82e85d64 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 15 Nov 2021 07:32:24 -0800 Subject: [PATCH] Disable `check_label_branch_invariants` in fuzzing This commit disables the `MachBuffer::check_label_branch_invariants` debug check on the fuzzers due to it causing timeouts with the test case from #3441. Fuzzing leads to a 20-30x slowdown of executed code and locally the fuzz time it takes to instantiate #3441 drops from 3 minutes to 6 seconds disabling this function. Note that this should still be executed during our testing on CI since it's still enabled for debug assertions. --- cranelift/codegen/src/machinst/buffer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cranelift/codegen/src/machinst/buffer.rs b/cranelift/codegen/src/machinst/buffer.rs index f1f2c29638..6871e8c470 100644 --- a/cranelift/codegen/src/machinst/buffer.rs +++ b/cranelift/codegen/src/machinst/buffer.rs @@ -334,7 +334,7 @@ impl MachBuffer { /// times, e.g. after calling `add_{cond,uncond}_branch()` and /// before emitting branch bytes. fn check_label_branch_invariants(&self) { - if !cfg!(debug_assertions) { + if !cfg!(debug_assertions) || cfg!(fuzzing) { return; } let cur_off = self.cur_offset();