about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-unwind.diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-15 21:31:06 +0000
committerbors <bors@rust-lang.org>2023-03-15 21:31:06 +0000
commite42bea9fdef30787709ddd1de9259717954e7bd6 (patch)
treea4ed0d9819c833e0fb4e10cee2ae0aa4f4eb868b /tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-unwind.diff
parent7b3bd56ed99d5031f57b1aaf814117b2a7ce9c84 (diff)
parent760275d81e67ae8953d40e64ff76691f0a55c5ff (diff)
downloadrust-e42bea9fdef30787709ddd1de9259717954e7bd6.tar.gz
rust-e42bea9fdef30787709ddd1de9259717954e7bd6.zip
Auto merge of #108282 - cjgillot:mir-checked-sh, r=tmiasko
Implement checked Shl/Shr at MIR building.

This does not require any special handling by codegen backends,
as the overflow behaviour is entirely determined by the rhs (shift amount).

This allows MIR ConstProp to remove the overflow check for constant shifts.

~There is an existing different behaviour between cg_llvm and cg_clif (cc `@bjorn3).`
I took cg_llvm's one as reference: overflow if `rhs < 0 || rhs > number_of_bits_in_lhs_ty`.~

EDIT: `cg_llvm` and `cg_clif` implement the overflow check differently. This PR uses `cg_llvm`'s implementation based on a `BitAnd` instead of `cg_clif`'s one based on an unsigned comparison.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions