aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/MachineVerifier/AMDGPU/verify-reg-sequence.mir
blob: 59625cd81ec3106a7281760f5b7a180c760f35d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# RUN: not --crash llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=none -o /dev/null %s 2>&1 | FileCheck %s

---
name: invalid_reg_sequence
tracksRegLiveness: true
body:             |
  bb.0:
    %0:vgpr_32 = IMPLICIT_DEF
    %1:vgpr_32 = IMPLICIT_DEF

    ; No operands
    ; CHECK: *** Bad machine code: Too few operands ***
    REG_SEQUENCE

    ; Only dest operand
    ; CHECK: *** Bad machine code: Too few operands ***
    %2:vreg_64 = REG_SEQUENCE

    ; Missing destination
    ; CHECK: *** Bad machine code: Explicit definition marked as use ***
    REG_SEQUENCE %0, %subreg.sub0, %1, %subreg.sub1

    ; Missing subreg operand
    ; CHECK: *** Bad machine code: Invalid number of operands for REG_SEQUENCE ***
    %3:vreg_64 = REG_SEQUENCE %0, %subreg.sub0, %1

    ; Missing register operand
    ; CHECK: *** Bad machine code: Invalid number of operands for REG_SEQUENCE ***
    %4:vreg_64 = REG_SEQUENCE %0, %subreg.sub0, %subreg.sub1

    ; Physreg destination
    ; CHECK: *** Bad machine code: REG_SEQUENCE does not support physical register results ***
    $vgpr0_vgpr1 = REG_SEQUENCE %0, %subreg.sub0, %1, %subreg.sub1

    ; Subreg in destination
    ; CHECK: *** Bad machine code: Invalid subreg result for REG_SEQUENCE ***
    %5.sub0_sub1:vreg_128 = REG_SEQUENCE %0, %subreg.sub0, %1, %subreg.sub1

    ; All operands are registers
    ; CHECK: *** Bad machine code: Invalid subregister index operand for REG_SEQUENCE ***
    %6:vreg_64 = REG_SEQUENCE %0, %1

    ; Register and subreg index operand order swapped
    ; CHECK: *** Bad machine code: Invalid register operand for REG_SEQUENCE ***
    ; CHECK: *** Bad machine code: Invalid subregister index operand for REG_SEQUENCE ***
    %7:vreg_64 = REG_SEQUENCE %subreg.sub0, %0, %subreg.sub1, %1

    ; Invalid subreg index constants
    ; CHECK: *** Bad machine code: Invalid subregister index operand for REG_SEQUENCE ***
    ; CHECK: - instruction: %8:vreg_64 = REG_SEQUENCE %0:vgpr_32, %subreg.0, %1:vgpr_32, %subreg.99999
    ; CHECK-NEXT: operand 2:   0

    ; CHECK: *** Bad machine code: Invalid subregister index operand for REG_SEQUENCE ***
    ; CHECK: instruction: %8:vreg_64 = REG_SEQUENCE %0:vgpr_32, %subreg.0, %1:vgpr_32, %subreg.99999
    ; CHECK-NEXT: operand 4:   99999
    %8:vreg_64 = REG_SEQUENCE %0, 0, %1, 99999

...