rust/compiler/rustc_codegen_llvm/src
bors dfa88b328f Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkin
Implement intrinsics with fallback bodies

fixes #93145 (though we can port many more intrinsics)
cc #63585

The way this works is that the backend logic for generating custom code for intrinsics has been made fallible. The only failure path is "this intrinsic is unknown". The `Instance` (that was `InstanceDef::Intrinsic`) then gets converted to `InstanceDef::Item`, which represents the fallback body. A regular function call to that body is then codegenned. This is currently implemented for

* codegen_ssa (so llvm and gcc)
* codegen_cranelift

other backends will need to adjust, but they can just keep doing what they were doing if they prefer (though adding new intrinsics to the compiler will then require them to implement them, instead of getting the fallback body).

cc `@scottmcm` `@WaffleLapkin`

### todo

* [ ] miri support
* [x] default intrinsic name to name of function instead of requiring it to be specified in attribute
* [x] make sure that the bodies are always available (must be collected for metadata)
2024-02-16 09:53:01 +00:00
..
back clean up potential_query_instability with FxIndexMap and UnordMap 2024-02-14 18:36:37 +08:00
coverageinfo clean up potential_query_instability with FxIndexMap and UnordMap 2024-02-14 18:36:37 +08:00
debuginfo Build DebugInfo for coroutine-closure 2024-02-09 16:01:29 +00:00
llvm Rollup merge of #120502 - clubby789:remove-ffi-returns-twice, r=compiler-errors 2024-02-06 22:45:42 +01:00
abi.rs Remove the abi_amdgpu_kernel feature 2024-01-30 15:46:40 +00:00
allocator.rs Add -Zuse-sync-unwind 2023-12-31 15:27:43 +08:00
asm.rs Support reg_addr register class in s390x inline assembly 2024-01-03 18:00:37 +09:00
attributes.rs is_closure_like 2024-02-11 22:09:52 +00:00
base.rs compiler: replace cstr macro with c str literals in compiler and few other c str replacements 2023-12-03 14:54:09 +03:00
builder.rs Auto merge of #118991 - nikic:scalar-pair, r=nagisa 2024-01-05 14:31:56 +00:00
callee.rs Fix clippy::needless_borrow in the compiler 2023-11-21 20:13:40 +01:00
common.rs ctfe interpreter: extend provenance so that it can track whether a pointer is immutable 2023-12-07 17:46:36 +01:00
consts.rs Remove Session methods that duplicate DiagCtxt methods. 2023-12-24 08:05:28 +11:00
context.rs Avoid ICE when is_val_statically_known is not of a supported type 2024-01-29 21:01:15 -05:00
declare.rs Add unstable -Zdefault-hidden-visibility cmdline flag for rustc. 2023-12-13 21:14:23 +00:00
errors.rs Rollup merge of #120631 - saethlin:invalid-target-ice, r=compiler-errors 2024-02-06 19:40:08 +01:00
intrinsic.rs Teach llvm backend how to fall back to default bodies 2024-02-12 17:50:39 +00:00
lib.rs Remove unnecessary #![feature(min_specialization)] 2024-02-10 12:26:14 +11:00
llvm_util.rs Implicitly enable evex512 if avx512 is enabled 2024-02-14 16:26:20 +01:00
mono_item.rs Add unstable -Z direct-access-external-data cmdline flag for rustc 2024-01-16 19:15:06 +08:00
type_.rs remove unused pub fn 2023-11-23 14:11:02 +03:00
type_of.rs Add CoroutineClosure to TyKind, AggregateKind, UpvarArgs 2024-02-06 02:22:58 +00:00
va_arg.rs cg_llvm: remove pointee types and pointercast/bitcast-of-ptr 2023-07-29 13:18:17 -04:00
value.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00