- Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
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)
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.