rust/compiler/rustc_codegen_cranelift/src
Michael Goulet 5460f92a0f
Rollup merge of #112168 - scottmcm:lower-div-rem-unchecked-to-mir, r=oli-obk
Lower `unchecked_div`/`_rem` to MIR's `BinOp::Div`/`Rem`

As described in <https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.BinOp.html#variant.Div>, the ordinary `BinOp`s for these are already UB for division by zero ([or overflow](https://llvm.org/docs/LangRef.html#sdiv-instruction), [demo](https://rust.godbolt.org/z/71e7P7Exh)), as MIR building is responsible for inserting code to panic for those cases regardless of whether the overflow checks are enabled.

So we can lower these in the same arm that lowers `wrapping_add` to MIR `BinOp::Add` and such, as all these cases turn into ordinary `Rvalue::BinaryOp`s.
2023-06-02 16:02:06 -07:00
..
abi Use is_some_and/is_ok_and in less obvious spots 2023-05-24 14:33:43 +00:00
debuginfo Merge commit 'dec0daa8f6' into sync_cg_clif-2023-03-15 2023-03-15 14:41:48 +00:00
driver Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
intrinsics remove unchecked_div/_rem from cg_cranelift 2023-06-01 00:05:55 -07:00
optimize Merge commit '598f090956' into sync_cg_clif-2023-01-24 2023-01-24 18:56:42 +01:00
allocator.rs Prevent insta-stable no alloc shim support 2023-05-11 14:35:09 +00:00
analyze.rs Split {Idx, IndexVec, IndexSlice} into their own modules 2023-04-24 13:53:35 +00:00
archive.rs Rewrite LLVM's archive writer in Rust 2022-11-26 19:35:32 +00:00
base.rs Remove DesugaringKind::Replace. 2023-05-25 17:40:46 +00:00
cast.rs Merge commit 'ef07e8e60f' into sync_cg_clif-2023-04-29 2023-04-29 12:00:43 +00:00
codegen_i128.rs Merge commit 'ef07e8e60f' into sync_cg_clif-2023-04-29 2023-04-29 12:00:43 +00:00
common.rs Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
compiler_builtins.rs Merge commit 'dec0daa8f6' into sync_cg_clif-2023-03-15 2023-03-15 14:41:48 +00:00
concurrency_limiter.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
config.rs Merge commit '7d53619064' into sync_cg_clif-2023-02-09 2023-02-09 12:38:16 +01:00
constant.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
discriminant.rs Remove from cranelift too. 2023-04-14 16:26:11 +00:00
global_asm.rs Merge commit 'ef07e8e60f' into sync_cg_clif-2023-04-29 2023-04-29 12:00:43 +00:00
inline_asm.rs Merge commit 'dec0daa8f6' into sync_cg_clif-2023-03-15 2023-03-15 14:41:48 +00:00
lib.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
linkage.rs Sync rustc_codegen_cranelift 'ddd4ce2553' 2021-04-30 14:49:58 +02:00
main_shim.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
num.rs Merge commit 'ef07e8e60f' into sync_cg_clif-2023-04-29 2023-04-29 12:00:43 +00:00
pointer.rs Merge commit 'dec0daa8f6' into sync_cg_clif-2023-03-15 2023-03-15 14:41:48 +00:00
pretty_clif.rs Avoid &format("...") calls in error message code. 2023-05-16 17:59:56 +10:00
toolchain.rs Merge commit 'e9d1a0a7b0' into sync_cg_clif-2022-08-24 2022-08-24 18:40:58 +02:00
trap.rs Merge commit 'e9d1a0a7b0' into sync_cg_clif-2022-08-24 2022-08-24 18:40:58 +02:00
unsize.rs Move mir::Fieldabi::FieldIdx 2023-03-28 22:22:37 -07:00
value_and_place.rs Restrict From<S> for {D,Subd}iagnosticMessage. 2023-05-03 08:44:39 +10:00
vtable.rs Move mir::Fieldabi::FieldIdx 2023-03-28 22:22:37 -07:00