xref: /llvm-project/llvm/test/CodeGen/AArch64/GlobalISel/select-add-low.mir (revision 1ee315ae7964c8433b772e0b5d667834994ba753)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=aarch64 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3
4--- |
5
6    @x = external hidden local_unnamed_addr global ptr, align 8
7
8    define void @select_add_low_without_offset() { ret void }
9    define void @select_add_low_with_offset() { ret void }
10    define void @select_add_low_without_adrp() { ret void }
11
12...
13---
14name:            select_add_low_without_offset
15legalized:       true
16regBankSelected: true
17tracksRegLiveness: true
18body:             |
19  bb.0:
20    liveins: $x0
21    ; CHECK-LABEL: name: select_add_low_without_offset
22    ; CHECK: liveins: $x0
23    ; CHECK: %add_low:gpr64common = MOVaddr target-flags(aarch64-page) @x, target-flags(aarch64-pageoff, aarch64-nc) @x
24    ; CHECK: $x0 = COPY %add_low
25    ; CHECK: RET_ReallyLR implicit $x0
26    %copy:gpr(p0) = COPY $x0
27    %adrp:gpr64(p0) = ADRP target-flags(aarch64-page) @x
28    %add_low:gpr(p0) = G_ADD_LOW %adrp(p0), target-flags(aarch64-pageoff, aarch64-nc) @x
29    $x0 = COPY %add_low
30    RET_ReallyLR implicit $x0
31
32...
33---
34name:            select_add_low_with_offset
35legalized:       true
36regBankSelected: true
37tracksRegLiveness: true
38body:             |
39  bb.0:
40    liveins: $x0
41    ; CHECK-LABEL: name: select_add_low_with_offset
42    ; CHECK: liveins: $x0
43    ; CHECK: %add_low:gpr64common = MOVaddr target-flags(aarch64-page) @x + 1, target-flags(aarch64-pageoff, aarch64-nc) @x + 1
44    ; CHECK: $x0 = COPY %add_low
45    ; CHECK: RET_ReallyLR implicit $x0
46    %copy:gpr(p0) = COPY $x0
47    %adrp:gpr64(p0) = ADRP target-flags(aarch64-page) @x + 1
48    %add_low:gpr(p0) = G_ADD_LOW %adrp(p0), target-flags(aarch64-pageoff, aarch64-nc) @x + 1
49    $x0 = COPY %add_low
50    RET_ReallyLR implicit $x0
51
52...
53---
54name:            select_add_low_without_adrp
55legalized:       true
56regBankSelected: true
57tracksRegLiveness: true
58body:             |
59  bb.0:
60    liveins: $x0
61    ; CHECK-LABEL: name: select_add_low_without_adrp
62    ; CHECK: liveins: $x0
63    ; CHECK: %ptr:gpr64sp = COPY $x0
64    ; CHECK: %add_low:gpr64sp = ADDXri %ptr, target-flags(aarch64-pageoff, aarch64-nc) @x, 0
65    ; CHECK: $x0 = COPY %add_low
66    ; CHECK: RET_ReallyLR implicit $x0
67    %ptr:gpr(p0) = COPY $x0
68    %add_low:gpr(p0) = G_ADD_LOW %ptr(p0), target-flags(aarch64-pageoff, aarch64-nc) @x
69    $x0 = COPY %add_low
70    RET_ReallyLR implicit $x0
71