rust/src
bors 50a067d7f8 Auto merge of #119911 - NCGThompson:is-statically-known, r=oli-obk
Replacement of #114390: Add new intrinsic `is_var_statically_known` and optimize pow for powers of two

This adds a new intrinsic `is_val_statically_known` that lowers to [``@llvm.is.constant.*`](https://llvm.org/docs/LangRef.html#llvm-is-constant-intrinsic).` It also applies the intrinsic in the int_pow methods to recognize and optimize the idiom `2isize.pow(x)`. See #114390 for more discussion.

While I have extended the scope of the power of two optimization from #114390, I haven't added any new uses for the intrinsic. That can be done in later pull requests.

Note: When testing or using the library, be sure to use `--stage 1` or higher. Otherwise, the intrinsic will be a noop and the doctests will be skipped. If you are trying out edits, you may be interested in [`--keep-stage 0`](https://rustc-dev-guide.rust-lang.org/building/suggested.html#faster-builds-with---keep-stage).

Fixes #47234
Resolves #114390
`@Centri3`
2024-01-25 05:16:53 +00:00
..
abi compiler: Lower fn call arg spans down to MIR 2024-01-15 19:07:11 +01:00
debuginfo Improved support of collapse_debuginfo attribute for macros. 2024-01-08 17:47:18 +07:00
driver Use chaining for DiagnosticBuilder construction and emit. 2024-01-08 15:45:29 +11:00
intrinsics Auto merge of #119911 - NCGThompson:is-statically-known, r=oli-obk 2024-01-25 05:16:53 +00:00
optimize
allocator.rs Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into sync_cg_clif-2023-10-09 2023-10-09 08:52:46 +00:00
analyze.rs remove redundant imports 2023-12-10 10:56:22 +08:00
archive.rs
base.rs Do not normalize closure signature when building FnOnce shim 2024-01-22 16:50:30 +00:00
cast.rs Merge commit '93a5433f17ab5ed48cc88f1e69b0713b16183373' into sync_cg_clif-2023-10-24 2023-10-24 12:22:23 +00:00
codegen_i128.rs Move TyCtxt::mk_x to Ty::new_x where applicable 2023-07-05 20:27:07 +01:00
common.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
compiler_builtins.rs Merge commit 'dec0daa8f6d0a0e1c702f169abb6bf3eee198c67' into sync_cg_clif-2023-03-15 2023-03-15 14:41:48 +00:00
concurrency_limiter.rs Rename many DiagCtxt arguments. 2023-12-18 16:06:22 +11:00
config.rs Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into sync_cg_clif-2023-06-15 2023-06-15 17:56:01 +00:00
constant.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
discriminant.rs Remove from cranelift too. 2023-04-14 16:26:11 +00:00
global_asm.rs Merge commit '6d355f6844323db03bfd608899613e363e701951' into sync_cg_clif-2023-12-31 2023-12-31 13:29:53 +00:00
inline_asm.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
lib.rs Remove more Session methods that duplicate DiagCtxt methods. 2023-12-24 08:17:47 +11:00
linkage.rs
main_shim.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
num.rs Move TyCtxt::mk_x to Ty::new_x where applicable 2023-07-05 20:27:07 +01:00
pointer.rs Merge commit '81dc066758ec150b43822d4a0c84aae20fe10f40' into sync_cg_clif-2023-10-09 2023-10-09 08:52:46 +00:00
pretty_clif.rs Rename EarlyErrorHandler as EarlyDiagCtxt. 2023-12-18 16:06:21 +11:00
toolchain.rs
trap.rs Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into sync_cg_clif-2023-06-15 2023-06-15 17:56:01 +00:00
unsize.rs Merge commit '3a9bf729322fb5035518f99b9d76a742bf7c124e' into sync_cg_clif-2023-12-19 2023-12-19 12:46:39 +00:00
value_and_place.rs Remove movability from TyKind::Coroutine 2023-12-28 16:35:01 +00:00
vtable.rs add helper method for finding the one non-1-ZST field 2023-09-12 20:52:05 +02:00