Closed
Description
On my system, a Zen 1 AMD CPU, attempting to run Criterion benchmarks with RUSTFLAGS = "-C target-cpu=znver1"
results in the benchmark hanging at the Analyzing
stage for a few minutes before I killed the program.
Without the flags, it doesn't hang at all, as expected.
This affects stable, beta and nightly, and is probably related to LLVM 9.
Code that can hang on stable:
#[macro_use]
extern crate criterion;
use criterion::{Criterion, ParameterizedBenchmark};
fn criterion_benchmark(c: &mut Criterion) {
c.bench(
"bench",
ParameterizedBenchmark::new(
"old",
|b, _| {
b.iter(|| {});
},
vec![()],
)
.with_function("new", |b, _| {
b.iter(|| {});
}),
);
}
criterion_group!(my_benches, criterion_benchmark);
criterion_main!(my_benches);
using cargo +stable bench
No special flags are present in the Cargo.toml
[package]
name = "bench-test"
version = "0.1.0"
authors = ["novacrazy <[email protected]>"]
edition = "2018"
[dev-dependencies]
criterion = "0.3.0"
[[bench]]
name = "benchmark_name"
harness = false
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Category: This is a bug.Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessToolchain: MSVC, Operating system: WindowsTarget: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Relevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.