Closed
Description
I tried this code:
#![feature(core_intrinsics)]
#![feature(bench_black_box)]
use std::intrinsics::unlikely;
pub fn foo(a: bool) {
if unlikely(a) {
std::hint::black_box(42);
}
std::hint::black_box(0xDEAD);
std::hint::black_box(0xBEEF);
}
I expected to see this happen: llvm.expect should be present in the IR
Instead, this happened: it's in debug mode, but gets dropped in release mode
Discovered here: #93668 (comment)