Skip to content

Commit ffa99b5

Browse files
committed
review updates
1 parent 2612823 commit ffa99b5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 1 addition & 0 deletions
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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,13 @@ impl StatementKind<'_> {
421421
TypeVisitable
422422
)]
423423
pub enum ExpectKind {
424-
True, // condition is probably true
425-
False, // condition is probably false
424+
/// condition is probably true
425+
True,
426+
427+
/// condition is probably false
428+
False,
429+
430+
/// condition is unpredictable by hardware
426431
Unpredictable,
427432
}
428433

0 commit comments

Comments
 (0)