rust/tests/codegen/intrinsics
bors 446649d463 Auto merge of #137513 - scottmcm:identity-transmute, r=saethlin
Don't re-`assume` in `transmute`s that don't change niches

I noticed in nightly 2025-02-21 that `transmute` is emitting way more `assume`s than necessary for newtypes.

For example, the three transmutes in <https://rust.godbolt.org/z/fW1KaTc4o> emits
```rust
define noundef range(i32 1, 0) i32 `@repeatedly_transparent_transmute(i32` noundef range(i32 1, 0) %_1) unnamed_addr {
start:
  %0 = sub i32 %_1, 1
  %1 = icmp ule i32 %0, -2
  call void `@llvm.assume(i1` %1)
  %2 = sub i32 %_1, 1
  %3 = icmp ule i32 %2, -2
  call void `@llvm.assume(i1` %3)
  %4 = sub i32 %_1, 1
  %5 = icmp ule i32 %4, -2
  call void `@llvm.assume(i1` %5)
  %6 = sub i32 %_1, 1
  %7 = icmp ule i32 %6, -2
  call void `@llvm.assume(i1` %7)
  %8 = sub i32 %_1, 1
  %9 = icmp ule i32 %8, -2
  call void `@llvm.assume(i1` %9)
  %10 = sub i32 %_1, 1
  %11 = icmp ule i32 %10, -2
  call void `@llvm.assume(i1` %11)
  ret i32 %_1
}
```

But those are all just newtypes that don't change size or niches, so none of it's needed.

After this PR it's down to just
```rust
define noundef range(i32 1, 0) i32 `@repeatedly_transparent_transmute(i32` noundef range(i32 1, 0) %_1) unnamed_addr {
start:
  ret i32 %_1
}
```
because none of those `assume`s in the original actually did anything.

(Transmuting to something with a difference niche, though, still has the assumes -- the other tests continue to pass checking that.)
2025-03-09 01:25:48 +00:00
..
aggregate-thin-pointer.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
carrying_mul_add.rs Update carrying_mul_add test to tolerate nuw 2025-01-03 20:25:14 +00:00
cold_path.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
cold_path2.rs Use trunc nuw+br for 0/1 branches even in optimized builds 2025-03-06 22:25:49 -08:00
cold_path3.rs improve cold_path() 2025-02-17 06:39:58 +01:00
compare_bytes.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
const_eval_select.rs Run rustfmt on tests/codegen/. 2024-05-31 15:56:43 +10:00
ctlz.rs Add codegen tests for changed intrinsics 2024-04-16 12:35:22 +00:00
ctpop.rs Add codegen tests for changed intrinsics 2024-04-16 12:35:22 +00:00
disjoint_bitor.rs Handle the case where the or disjoint folds immediately to a constant 2025-02-02 21:04:10 -08:00
exact_div.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
likely.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
likely_assert.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
mask.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
nontemporal.rs tests: use minicore more 2025-02-24 09:26:54 +00:00
offset.rs Emit getelementptr inbounds nuw for pointer::add() 2025-02-19 11:32:32 +01:00
offset_from.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
prefetch.rs Run rustfmt on tests/codegen/. 2024-05-31 15:56:43 +10:00
ptr_metadata.rs Emit getelementptr inbounds nuw for pointer::add() 2025-02-19 11:32:32 +01:00
rotate_left.rs Add codegen tests for changed intrinsics 2024-04-16 12:35:22 +00:00
rustc_intrinsic_must_be_overridden.rs Don't generate functions with the rustc_intrinsic_must_be_overridden attribute 2024-08-19 06:26:52 +08:00
select_unpredictable.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
three_way_compare.rs Set signext or zeroext for integer arguments on RISC-V 2024-10-23 04:42:03 +02:00
transmute-niched.rs Emit trunc nuw for unchecked shifts and to_immediate_scalar 2025-02-19 11:36:52 -08:00
transmute-x64.rs x86-sse2 ABI: use SSE registers for floats and SIMD 2025-02-18 16:11:41 +01:00
transmute.rs Don't re-assume in transmutes that don't change niches 2025-02-23 23:18:04 -08:00
typed_swap.rs rename typed_swap → typed_swap_nonoverlapping 2024-12-25 10:53:03 +01:00
unchecked_math.rs
unlikely.rs tests/codegen: use -Copt-level=3 instead of -O 2025-02-11 13:41:35 -08:00
volatile.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
volatile_order.rs