about summary refs log tree commit diff
path: root/tests/codegen/lib-optimizations
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-07-21 14:34:12 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-07-22 14:28:48 +0200
commita27f3e3fd1e4d16160f8885b6b06665b5319f56c (patch)
treeb033935392cbadf6f85d2dbddf433a88e323aeeb /tests/codegen/lib-optimizations
parented93c1783b404d728d4809973a0550eb33cd293f (diff)
downloadrust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.tar.gz
rust-a27f3e3fd1e4d16160f8885b6b06665b5319f56c.zip
Rename `tests/codegen` into `tests/codegen-llvm`
Diffstat (limited to 'tests/codegen/lib-optimizations')
-rw-r--r--tests/codegen/lib-optimizations/iter-sum.rs13
-rw-r--r--tests/codegen/lib-optimizations/slice_rotate.rs30
2 files changed, 0 insertions, 43 deletions
diff --git a/tests/codegen/lib-optimizations/iter-sum.rs b/tests/codegen/lib-optimizations/iter-sum.rs
deleted file mode 100644
index a054ffffe74..00000000000
--- a/tests/codegen/lib-optimizations/iter-sum.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ compile-flags: -Copt-level=3
-//@ only-x86_64 (vectorization varies between architectures)
-#![crate_type = "lib"]
-
-// Ensure that slice + take + sum gets vectorized.
-// Currently this relies on the slice::Iter::try_fold implementation
-// CHECK-LABEL: @slice_take_sum
-#[no_mangle]
-pub fn slice_take_sum(s: &[u64], l: usize) -> u64 {
-    // CHECK: vector.body:
-    // CHECK: ret
-    s.iter().take(l).sum()
-}
diff --git a/tests/codegen/lib-optimizations/slice_rotate.rs b/tests/codegen/lib-optimizations/slice_rotate.rs
deleted file mode 100644
index aa4bb3b528c..00000000000
--- a/tests/codegen/lib-optimizations/slice_rotate.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-//@ compile-flags: -Copt-level=3
-
-#![crate_type = "lib"]
-
-// Ensure that the simple case of rotating by a constant 1 optimizes to the obvious thing
-
-// CHECK-LABEL: @rotate_left_by_one
-#[no_mangle]
-pub fn rotate_left_by_one(slice: &mut [i32]) {
-    // CHECK-NOT: phi
-    // CHECK-NOT: call
-    // CHECK-NOT: load
-    // CHECK-NOT: store
-    // CHECK-NOT: getelementptr
-    // CHECK: %[[END:.+]] = getelementptr
-    // CHECK-NEXT: %[[DIM:.+]] = getelementptr
-    // CHECK-NEXT: %[[LAST:.+]] = load
-    // CHECK-NEXT: %[[FIRST:.+]] = shl
-    // CHECK-NEXT: call void @llvm.memmove
-    // CHECK-NEXT: store i32 %[[LAST]], ptr %[[DIM:.+]]
-    // CHECK-NOT: phi
-    // CHECK-NOT: call
-    // CHECK-NOT: load
-    // CHECK-NOT: store
-    // CHECK-NOT: getelementptr
-    // CHECK: ret void
-    if !slice.is_empty() {
-        slice.rotate_left(1);
-    }
-}