diff options
| author | bors <bors@rust-lang.org> | 2024-11-17 23:57:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-11-17 23:57:53 +0000 |
| commit | 3fb7e441aecc3c054d71eb4d752d06e7776e8888 (patch) | |
| tree | bba0b25b682b37f1b6040aa63949559619666e9d /compiler/rustc_codegen_llvm/src | |
| parent | 5ec7d6eee7e0f5236ec1559499070eaf836bc608 (diff) | |
| parent | 777003ae9fd4d81ada91f67f388d4f12c9ca220a (diff) | |
| download | rust-3fb7e441aecc3c054d71eb4d752d06e7776e8888.tar.gz rust-3fb7e441aecc3c054d71eb4d752d06e7776e8888.zip | |
Auto merge of #120370 - x17jiri:likely_unlikely_fix, r=saethlin
Likely unlikely fix RFC 1131 ( https://github.com/rust-lang/rust/issues/26179 ) added likely/unlikely intrinsics, but they have been broken for a while: https://github.com/rust-lang/rust/issues/96276 , https://github.com/rust-lang/rust/issues/96275 , https://github.com/rust-lang/rust/issues/88767 . This PR tries to fix them. Changes: - added a new `cold_path()` intrinsic - `likely()` and `unlikely()` changed to regular functions implemented using `cold_path()`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/intrinsic.rs | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index e9c687d75e3..b56f464975d 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -192,7 +192,6 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { Some(instance), ) } - sym::likely => self.expect(args[0].immediate(), true), sym::is_val_statically_known => { let intrinsic_type = args[0].layout.immediate_llvm_type(self.cx); let kind = self.type_kind(intrinsic_type); @@ -213,7 +212,6 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { self.const_bool(false) } } - sym::unlikely => self.expect(args[0].immediate(), false), sym::select_unpredictable => { let cond = args[0].immediate(); assert_eq!(args[1].layout, args[2].layout); |
