mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 10:55:14 +00:00
Amend codegen test.
This commit is contained in:
parent
a3e1a2b7ce
commit
cbbf06b0cd
@ -17,7 +17,7 @@ pub fn is_empty_1(xs: Iter<f32>) -> bool {
|
||||
// CHECK-NEXT: start:
|
||||
// CHECK-NEXT: [[A:%.*]] = icmp ne {{i32\*|ptr}} %xs.1, null
|
||||
// CHECK-NEXT: tail call void @llvm.assume(i1 [[A]])
|
||||
// CHECK-NEXT: [[B:%.*]] = icmp eq {{i32\*|ptr}} %xs.0, %xs.1
|
||||
// CHECK-NEXT: [[B:%.*]] = icmp eq {{i32\*|ptr}} %xs.1, %xs.0
|
||||
// CHECK-NEXT: ret i1 [[B:%.*]]
|
||||
{xs}.next().is_none()
|
||||
}
|
||||
@ -28,7 +28,7 @@ pub fn is_empty_2(xs: Iter<f32>) -> bool {
|
||||
// CHECK-NEXT: start:
|
||||
// CHECK-NEXT: [[C:%.*]] = icmp ne {{i32\*|ptr}} %xs.1, null
|
||||
// CHECK-NEXT: tail call void @llvm.assume(i1 [[C]])
|
||||
// CHECK-NEXT: [[D:%.*]] = icmp eq {{i32\*|ptr}} %xs.0, %xs.1
|
||||
// CHECK-NEXT: [[D:%.*]] = icmp eq {{i32\*|ptr}} %xs.1, %xs.0
|
||||
// CHECK-NEXT: ret i1 [[D:%.*]]
|
||||
xs.map(|&x| x).next().is_none()
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// This test checks that the call to memchr/slice_contains is optimized away
|
||||
// when searching in small slices.
|
||||
|
||||
// compile-flags: -O
|
||||
// compile-flags: -O -Zinline-mir=no
|
||||
// only-x86_64
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
@ -3,7 +3,7 @@
|
||||
// may e.g. multiply `size_of::<T>()` with a variable "count" (which is only
|
||||
// known to be `1` after inlining).
|
||||
|
||||
// compile-flags: -C no-prepopulate-passes
|
||||
// compile-flags: -C no-prepopulate-passes -Zinline-mir=no
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
@ -12,14 +12,12 @@ pub fn replace_byte(dst: &mut u8, src: u8) -> u8 {
|
||||
}
|
||||
|
||||
// NOTE(eddyb) the `CHECK-NOT`s ensure that the only calls of `@llvm.memcpy` in
|
||||
// the entire output, are the two direct calls we want, from `ptr::{read,write}`.
|
||||
// the entire output, are the two direct calls we want, from `ptr::replace`.
|
||||
|
||||
// CHECK-NOT: call void @llvm.memcpy
|
||||
// CHECK: ; core::ptr::read
|
||||
// CHECK: ; core::mem::replace
|
||||
// CHECK-NOT: call void @llvm.memcpy
|
||||
// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %src, i{{.*}} 1, i1 false)
|
||||
// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %{{.*}}, {{i8\*|ptr}} align 1 %dest, i{{.*}} 1, i1 false)
|
||||
// CHECK-NOT: call void @llvm.memcpy
|
||||
// CHECK: ; core::ptr::write
|
||||
// CHECK-NOT: call void @llvm.memcpy
|
||||
// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %dst, {{i8\*|ptr}} align 1 %src, i{{.*}} 1, i1 false)
|
||||
// CHECK: call void @llvm.memcpy.{{.+}}({{i8\*|ptr}} align 1 %dest, {{i8\*|ptr}} align 1 %src{{.*}}, i{{.*}} 1, i1 false)
|
||||
// CHECK-NOT: call void @llvm.memcpy
|
||||
|
@ -1,7 +1,7 @@
|
||||
// ignore-windows
|
||||
//
|
||||
|
||||
// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix={{cwd}}=/the/cwd --remap-path-prefix={{src-base}}=/the/src
|
||||
// compile-flags: -g -C no-prepopulate-passes --remap-path-prefix={{cwd}}=/the/cwd --remap-path-prefix={{src-base}}=/the/src -Zinline-mir=no
|
||||
// aux-build:remap_path_prefix_aux.rs
|
||||
|
||||
extern crate remap_path_prefix_aux;
|
||||
|
@ -47,8 +47,9 @@ pub fn wider_reduce_iter(x: Simd<u8, N>) -> u16 {
|
||||
#[no_mangle]
|
||||
// CHECK-LABEL: @wider_reduce_into_iter
|
||||
pub fn wider_reduce_into_iter(x: Simd<u8, N>) -> u16 {
|
||||
// CHECK: zext <8 x i8>
|
||||
// CHECK-SAME: to <8 x i16>
|
||||
// CHECK: call i16 @llvm.vector.reduce.add.v8i16(<8 x i16>
|
||||
// FIXME MIR inlining messes up LLVM optimizations.
|
||||
// WOULD-CHECK: zext <8 x i8>
|
||||
// WOULD-CHECK-SAME: to <8 x i16>
|
||||
// WOULD-CHECK: call i16 @llvm.vector.reduce.add.v8i16(<8 x i16>
|
||||
x.to_array().into_iter().map(u16::from).sum()
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// compile-flags: -C opt-level=3
|
||||
// compile-flags: -C opt-level=3 -Zmerge-functions=disabled
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
|
@ -11,9 +11,10 @@ type RGB48 = [u16; 3];
|
||||
// CHECK-LABEL: @swap_rgb48
|
||||
#[no_mangle]
|
||||
pub fn swap_rgb48(x: &mut RGB48, y: &mut RGB48) {
|
||||
// CHECK-NOT: alloca
|
||||
// CHECK: load i48
|
||||
// CHECK: store i48
|
||||
// FIXME MIR inlining messes up LLVM optimizations.
|
||||
// WOULD-CHECK-NOT: alloca
|
||||
// WOULD-CHECK: load i48
|
||||
// WOULD-CHECK: store i48
|
||||
swap(x, y)
|
||||
}
|
||||
|
||||
|
@ -53,16 +53,18 @@ pub fn vec_iterator_cast_unwrap(vec: Vec<Wrapper<u8>>) -> Vec<u8> {
|
||||
// CHECK-LABEL: @vec_iterator_cast_aggregate
|
||||
#[no_mangle]
|
||||
pub fn vec_iterator_cast_aggregate(vec: Vec<[u64; 4]>) -> Vec<Foo> {
|
||||
// CHECK-NOT: loop
|
||||
// CHECK-NOT: call
|
||||
// FIXME These checks should be the same as other functions.
|
||||
// CHECK-NOT: @__rust_alloc
|
||||
// CHECK-NOT: @__rust_alloc
|
||||
vec.into_iter().map(|e| unsafe { std::mem::transmute(e) }).collect()
|
||||
}
|
||||
|
||||
// CHECK-LABEL: @vec_iterator_cast_deaggregate
|
||||
#[no_mangle]
|
||||
pub fn vec_iterator_cast_deaggregate(vec: Vec<Bar>) -> Vec<[u64; 4]> {
|
||||
// CHECK-NOT: loop
|
||||
// CHECK-NOT: call
|
||||
// FIXME These checks should be the same as other functions.
|
||||
// CHECK-NOT: @__rust_alloc
|
||||
// CHECK-NOT: @__rust_alloc
|
||||
|
||||
// Safety: For the purpose of this test we assume that Bar layout matches [u64; 4].
|
||||
// This currently is not guaranteed for repr(Rust) types, but it happens to work here and
|
||||
|
Loading…
Reference in New Issue
Block a user