xref: /aosp_15_r20/external/llvm/test/Analysis/CostModel/ARM/shuffle.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s  -cost-model -analyze -mtriple=thumbv7-apple-ios6.0.0 -mcpu=swift | FileCheck %s
2*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
3*9880d681SAndroid Build Coastguard Workertarget triple = "thumbv7-apple-ios6.0.0"
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker; CHECK: shuffle
6*9880d681SAndroid Build Coastguard Workerdefine void @shuffle() {
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker
9*9880d681SAndroid Build Coastguard Worker  ;; Reverse shuffles should be lowered to vrev and possibly a vext (for
10*9880d681SAndroid Build Coastguard Worker  ;; quadwords)
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker    ; Vector values
13*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} shuffle
14*9880d681SAndroid Build Coastguard Worker  %v7 = shufflevector <2 x i8> undef, <2 x i8>undef, <2 x i32> <i32 1, i32 0>
15*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} shuffle
16*9880d681SAndroid Build Coastguard Worker  %v8 = shufflevector <4 x i8> undef, <4 x i8>undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
17*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} shuffle
18*9880d681SAndroid Build Coastguard Worker  %v9 = shufflevector <8 x i8> undef, <8 x i8>undef, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
19*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 2 {{.*}} shuffle
20*9880d681SAndroid Build Coastguard Worker  %v10 = shufflevector <16 x i8> undef, <16 x i8>undef, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} shuffle
23*9880d681SAndroid Build Coastguard Worker  %v11 = shufflevector <2 x i16> undef, <2 x i16>undef, <2 x i32> <i32 1, i32 0>
24*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} shuffle
25*9880d681SAndroid Build Coastguard Worker  %v12 = shufflevector <4 x i16> undef, <4 x i16>undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
26*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 2 {{.*}} shuffle
27*9880d681SAndroid Build Coastguard Worker  %v13 = shufflevector <8 x i16> undef, <8 x i16>undef, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} shuffle
30*9880d681SAndroid Build Coastguard Worker  %v14 = shufflevector <2 x i32> undef, <2 x i32>undef, <2 x i32> <i32 1, i32 0>
31*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 2 {{.*}} shuffle
32*9880d681SAndroid Build Coastguard Worker  %v15 = shufflevector <4 x i32> undef, <4 x i32>undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 1 {{.*}} shuffle
35*9880d681SAndroid Build Coastguard Worker  %v16 = shufflevector <2 x float> undef, <2 x float>undef, <2 x i32> <i32 1, i32 0>
36*9880d681SAndroid Build Coastguard Worker  ; CHECK: cost of 2 {{.*}} shuffle
37*9880d681SAndroid Build Coastguard Worker  %v17 = shufflevector <4 x float> undef, <4 x float>undef, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Worker  ret void
40*9880d681SAndroid Build Coastguard Worker}
41