[TTI] getTypeBasedIntrinsicInstrCost - add basic handling for strided load/store...
[llvm-project.git] / llvm / test / MachineVerifier / test_g_insert_subvector.mir
blob84cb249d74eb7935fc8e983a1355880496cd160b
1 # RUN: not --crash llc -o - -run-pass=none -verify-machineinstrs -mtriple=arm64 %s 2>&1 | FileCheck %s
2 # REQUIRES: aarch64-registered-target
4 ---
5 name:            g_splat_vector
6 tracksRegLiveness: true
7 liveins:
8 body:             |
9   bb.0:
10     %0:_(s32) = G_CONSTANT i32 0
11     %1:_(<vscale x 2 x s32>) = G_IMPLICIT_DEF
12     %2:_(<vscale x 1 x s32>) = G_IMPLICIT_DEF
14     ; CHECK: generic instruction must use register operands
15     ; CHECK: G_INSERT_SUBVECTOR first source must be a register
16     %3:_(<vscale x 2 x s32>) = G_INSERT_SUBVECTOR 1, %2, 0
18     ; CHECK: generic instruction must use register operands
19     ; CHECK: G_INSERT_SUBVECTOR second source must be a register
20     %4:_(<vscale x 2 x s32>) = G_INSERT_SUBVECTOR %1, 1, 0
22     ; CHECK: G_INSERT_SUBVECTOR index must be an immediate
23     %5:_(<vscale x 2 x s32>) = G_INSERT_SUBVECTOR %1, %2, %0
25     ; CHECK: Destination type must be a vector
26     %6:_(s32) = G_INSERT_SUBVECTOR %1, %2, 0
28     ; CHECK: Type mismatch in generic instruction
29     %7:_(<vscale x 2 x s32>) = G_INSERT_SUBVECTOR %0, %2, 0
31     ; CHECK: Second source must be a vector
32     %8:_(<vscale x 2 x s32>) = G_INSERT_SUBVECTOR %1, %0, 0
34     ; CHECK: Type mismatch in generic instruction
35     %9:_(<vscale x 2 x s32>) = G_INSERT_SUBVECTOR %2, %1, 0
37     %10:_(<vscale x 1 x s16>) = G_IMPLICIT_DEF
39     ; CHECK: Element type of vectors must be the same
40     %11:_(<vscale x 2 x s32>) = G_INSERT_SUBVECTOR %1, %10, 0
42     %12:_(<vscale x 4 x s32>) = G_IMPLICIT_DEF
44     ; CHECK: Index must be a multiple of the second source vector's minimum vector length
45     %13:_(<vscale x 4 x s32>) = G_INSERT_SUBVECTOR %12, %1, 3
47     ; CHECK: Index must be a multiple of the second source vector's minimum vector length
48     %14:_(<vscale x 4 x s32>) = G_INSERT_SUBVECTOR %12, %1, 1
50     %15:_(<vscale x 4 x s32>) = G_IMPLICIT_DEF
52     ; CHECK: Second source must be smaller than destination vector
53     %16:_(<vscale x 2 x s32>) = G_INSERT_SUBVECTOR %1, %15, 0
55     ; CHECK: Subvector type and index must not cause insert to overrun the vector being inserted into
56     %17:_(<vscale x 4 x s32>) = G_INSERT_SUBVECTOR %12, %1, 4
58     %18:_(<vscale x 3 x s32>) = G_IMPLICIT_DEF
60     ; CHECK: Subvector type and index must not cause insert to overrun the vector being inserted into
61     %19:_(<vscale x 3 x s32>) = G_INSERT_SUBVECTOR %18, %1, 2
63     %20:_(<2 x s32>) = G_IMPLICIT_DEF
65     ; CHECK: Vector types must both be fixed or both be scalable
66     %21:_(<vscale x 1 x s32>) = G_INSERT_SUBVECTOR %12, %20, 2
67 ...