rust/compiler/rustc_mir_dataflow/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
..
framework Remove unused features 2024-01-25 14:01:33 +00:00
impls Use a plain bitset for liveness analyses. 2024-01-22 23:18:45 +00:00
move_paths Rollup merge of #120802 - oli-obk:drop_elab_ice, r=compiler-errors 2024-02-13 06:27:38 +01:00
debuginfo.rs Preserve DebugInfo in DeadStoreElimination. 2023-10-06 15:46:11 +00:00
drop_flag_effects.rs Remove unused arguments from on_all_children_bits. 2023-11-24 06:36:27 +11:00
elaborate_drops.rs Add CoroutineClosure to TyKind, AggregateKind, UpvarArgs 2024-02-06 02:22:58 +00:00
errors.rs Migrate all diagnostics 2022-10-23 10:09:44 +02:00
lib.rs Remove unnecessary min_specialization after bootstrap 2024-02-10 18:15:11 +11:00
points.rs Use a plain bitset for liveness analyses. 2024-01-22 23:18:45 +00:00
rustc_peek.rs Make is_intrinsic query return the intrinsic name 2024-02-12 09:33:52 +00:00
storage.rs Replace Body::basic_blocks() with field access 2022-08-26 14:27:08 +02:00
un_derefer.rs Avoid unnecessary exports. 2023-11-23 14:06:57 +11:00
value_analysis.rs More comments, final tweaks 2024-02-06 02:22:58 +00:00