Skip to content

Commit 786f88b

Browse files
tests: Revise dont-shuffle-bswaps-opt3 per tested arch
Some architectures gain target-cpu minimums in doing so.
1 parent db39bbd commit 786f88b

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

tests/codegen/autovec/dont-shuffle-bswaps-opt2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#![crate_type = "lib"]
55
#![no_std]
66

7+
// This test is paired with the arch-specific -opt3.rs test.
8+
79
// The code is from https://github.com/rust-lang/rust/issues/122805.
810
// Ensure we do not generate the shufflevector instruction
911
// to avoid complicating the code.

tests/codegen/autovec/dont-shuffle-bswaps-opt3.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
//@ revisions: OPT3 OPT3_S390X
2-
//@[OPT3] compile-flags: -C opt-level=3
3-
// some targets don't do the opt we are looking for
4-
//@[OPT3] only-64bit
5-
//@[OPT3] ignore-s390x
6-
//@[OPT3_S390X] compile-flags: -C opt-level=3 -C target-cpu=z13
7-
//@[OPT3_S390X] only-s390x
1+
//@ revisions: AARCH64 POWER9 X86_64 Z13
2+
//@ compile-flags: -Copt-level=3
3+
//@[AARCH64] only-aarch64
4+
//@[X86_64] only-x86_64
5+
//@[Z13] only-s390x
6+
//@[Z13] compile-flags: -Ctarget-cpu=z13
87

98
#![crate_type = "lib"]
109
#![no_std]
1110

11+
// This test is paired with the arch-neutral -opt2.rs test
12+
1213
// The code is from https://github.com/rust-lang/rust/issues/122805.
1314
// Ensure we do not generate the shufflevector instruction
1415
// to avoid complicating the code.
16+
1517
// CHECK-LABEL: define{{.*}}void @convert(
1618
// CHECK-NOT: shufflevector
19+
1720
// On higher opt levels, this should just be a bswap:
18-
// OPT3: load <8 x i16>
19-
// OPT3-NEXT: call <8 x i16> @llvm.bswap
20-
// OPT3-NEXT: store <8 x i16>
21-
// OPT3-NEXT: ret void
22-
// OPT3_S390X: load <8 x i16>
23-
// OPT3_S390X-NEXT: call <8 x i16> @llvm.bswap
24-
// OPT3_S390X-NEXT: store <8 x i16>
25-
// OPT3_S390X-NEXT: ret void
21+
// CHECK: load <8 x i16>
22+
// CHECK-NEXT: call <8 x i16> @llvm.bswap
23+
// CHECK-NEXT: store <8 x i16>
24+
// CHECK-NEXT: ret void
2625
#[no_mangle]
2726
pub fn convert(value: [u16; 8]) -> [u8; 16] {
2827
#[cfg(target_endian = "little")]

0 commit comments

Comments
 (0)