xref: /llvm-project/llvm/test/CodeGen/ARM/GlobalISel/arm-legalizer.mir (revision fae05692a36f9ebbd201d93c2a6b0f927564d7e6)
1# RUN: llc -mtriple arm-- -run-pass=legalizer %s -o - | FileCheck %s
2--- |
3  define void @test_constants_s64() { ret void }
4
5  define void @test_phi_s64() #0 { ret void }
6
7  attributes #0 = { "target-features"="+vfp2" }
8...
9---
10name:            test_constants_s64
11# CHECK-LABEL: name: test_constants_s64
12legalized:       false
13# CHECK: legalized: true
14regBankSelected: false
15selected:        false
16tracksRegLiveness: true
17registers:
18  - { id: 0, class: _ }
19  - { id: 1, class: _ }
20  - { id: 2, class: _ }
21  - { id: 3, class: _ }
22body:             |
23  bb.0:
24    liveins: $r0
25
26    %0(p0) = COPY $r0
27
28    %1(s64) = G_CONSTANT i64 17179869200 ; = 4 * 2 ^ 32 + 16
29    %2(s32), %3(s32) = G_UNMERGE_VALUES %1(s64)
30    G_STORE %2(s32), %0(p0) :: (store (s32))
31    G_STORE %3(s32), %0(p0) :: (store (s32))
32    ; CHECK-DAG: {{%[0-9]+}}:_(s32) = G_CONSTANT i32 4
33    ; CHECK-DAG: {{%[0-9]+}}:_(s32) = G_CONSTANT i32 16
34    ; CHECK-NOT: G_CONSTANT i64
35
36    BX_RET 14, $noreg
37...
38---
39name:            test_phi_s64
40# CHECK-LABEL: name: test_phi_s64
41legalized:       false
42# CHECK: legalized: true
43regBankSelected: false
44selected:        false
45tracksRegLiveness: true
46registers:
47  - { id: 0, class: _ }
48  - { id: 1, class: _ }
49  - { id: 2, class: _ }
50  - { id: 3, class: _ }
51  - { id: 4, class: _ }
52body:             |
53  bb.0:
54    liveins: $r0, $d0, $d1
55
56    %0(s32) = COPY $r0
57    %1(s1) = G_TRUNC %0(s32)
58
59    %2(s64) = COPY $d0
60    %3(s64) = COPY $d1
61
62    G_BRCOND %1(s1), %bb.1
63    G_BR %bb.2
64
65  bb.1:
66    G_BR %bb.2
67
68  bb.2:
69    %4(s64) = G_PHI %2(s64), %bb.0, %3(s64), %bb.1
70    ; G_PHI with s64 is legal when we have floating point support, so we should
71    ; find it unchanged in the output
72    ; CHECK: G_PHI {{%[0-9]+}}(s64), %bb.0, {{%[0-9]+}}(s64), %bb.1
73    $d0 = COPY %4(s64)
74    BX_RET 14, $noreg, implicit $d0
75...
76