1# RUN: llc -march=hexagon -run-pass hexagon-cext-opt -hexagon-cext-threshold=3 %s -o - | FileCheck %s
2
3--- |
4  define void @test0() { ret void }
5  define void @test1() { ret void }
6  define void @test2() { ret void }
7  @global_address = global [1024 x i32] zeroinitializer, align 8
8...
9
10# CHECK-LABEL: name: test0
11# CHECK: [[B:%[0-9]+]]:intregs = A2_tfrsi @global_address
12# CHECK: L2_loadri_io [[B]], 0
13# CHECK: L2_loadri_io [[B]], 4
14# CHECK: L2_loadri_io [[B]], 8
15---
16name: test0
17registers:
18  - { id: 0, class: intregs }
19  - { id: 1, class: intregs }
20  - { id: 2, class: intregs }
21body: |
22  bb.0:
23    %0 = PS_loadriabs @global_address
24    %1 = PS_loadriabs @global_address+4
25    %2 = PS_loadriabs @global_address+8
26...
27
28# CHECK-LABEL: name: test1
29# CHECK: [[C:%[0-9]+]]:intregs = COPY $r0
30# CHECK: [[B:%[0-9]+]]:intregs = A2_addi [[C]], @global_address
31# CHECK: L2_loadri_io [[B]], 0
32# CHECK: L2_loadri_io [[B]], 4
33# CHECK: L2_loadri_io [[B]], 8
34---
35name: test1
36registers:
37  - { id: 0, class: intregs }
38  - { id: 1, class: intregs }
39  - { id: 2, class: intregs }
40  - { id: 3, class: intregs }
41body: |
42  bb.0:
43    liveins: $r0
44    %0 = COPY $r0
45    %1 = L4_loadri_ur %0, 0, @global_address
46    %2 = L4_loadri_ur %0, 0, @global_address+4
47    %3 = L4_loadri_ur %0, 0, @global_address+8
48...
49
50# CHECK-LABEL: name: test2
51# CHECK: [[C:%[0-9]+]]:intregs = COPY $r0
52# CHECK: [[B:%[0-9]+]]:intregs = A2_tfrsi @global_address + 4
53# CHECK: [[T0:%[0-9]+]]:intregs = A2_addi [[B]], -4
54# CHECK: $r0 = COPY [[T0]]
55# CHECK: [[T1:%[0-9]+]]:intregs = A2_addi [[B]], -2
56# CHECK: $r1 = COPY [[T1]]
57# CHECK: L4_loadri_rr [[B]], [[C]], 0
58---
59name: test2
60registers:
61  - { id: 0, class: intregs }
62  - { id: 1, class: intregs }
63  - { id: 2, class: intregs }
64  - { id: 3, class: intregs }
65body: |
66  bb.0:
67    liveins: $r0
68    %0 = COPY $r0
69    %1 = A2_tfrsi @global_address
70    $r0 = COPY %1
71    %2 = A2_tfrsi @global_address+2
72    $r1 = COPY %2
73    %3 = L4_loadri_ur %0, 0, @global_address+4
74...
75