Skip to content

Commit 9a5d454

Browse files
committed
review updates
1 parent 27fd54f commit 9a5d454

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
211211
match expect {
212212
ExpectKind::None => {}
213213
ExpectKind::True | ExpectKind::False => unsafe {
214+
// Use weights 2000 and 1, which is what Clang uses
214215
let s = "branch_weights";
215216
let v = [
216217
llvm::LLVMMDStringInContext(

compiler/rustc_middle/src/mir/syntax.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,13 @@ impl StatementKind<'_> {
422422
TypeVisitable
423423
)]
424424
pub enum ExpectKind {
425-
True, // condition is probably true
426-
False, // condition is probably false
425+
/// condition is probably true
426+
True,
427+
428+
/// condition is probably false
429+
False,
430+
431+
/// condition is unpredictable by hardware
427432
Unpredictable,
428433
}
429434

0 commit comments

Comments
 (0)