1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
10 ; CHECK-LABEL: name: p0_s64
13 ; CHECK-NEXT: %ptr:_(p0) = COPY $x0
14 ; CHECK-NEXT: %int:_(s64) = G_PTRTOINT %ptr(p0)
15 ; CHECK-NEXT: $x0 = COPY %int(s64)
16 ; CHECK-NEXT: RET_ReallyLR implicit $x0
18 %int:_(s64) = G_PTRTOINT %ptr
20 RET_ReallyLR implicit $x0
27 ; CHECK-LABEL: name: p0_s32
30 ; CHECK-NEXT: %ptr:_(p0) = COPY $x0
31 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT %ptr(p0)
32 ; CHECK-NEXT: %int:_(s32) = G_TRUNC [[PTRTOINT]](s64)
33 ; CHECK-NEXT: $w0 = COPY %int(s32)
34 ; CHECK-NEXT: RET_ReallyLR implicit $w0
36 %int:_(s32) = G_PTRTOINT %ptr
38 RET_ReallyLR implicit $w0
45 ; CHECK-LABEL: name: p0_s16
46 ; CHECK: liveins: $x0, $h0
48 ; CHECK-NEXT: %ptr:_(p0) = COPY $x0
49 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT %ptr(p0)
50 ; CHECK-NEXT: %int:_(s16) = G_TRUNC [[PTRTOINT]](s64)
51 ; CHECK-NEXT: $h0 = COPY %int(s16)
52 ; CHECK-NEXT: RET_ReallyLR implicit $h0
54 %int:_(s16) = G_PTRTOINT %ptr
56 RET_ReallyLR implicit $h0
63 ; CHECK-LABEL: name: p0_s8
64 ; CHECK: liveins: $x0, $b0
66 ; CHECK-NEXT: %ptr:_(p0) = COPY $x0
67 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT %ptr(p0)
68 ; CHECK-NEXT: %int:_(s8) = G_TRUNC [[PTRTOINT]](s64)
69 ; CHECK-NEXT: $b0 = COPY %int(s8)
70 ; CHECK-NEXT: RET_ReallyLR implicit $b0
72 %int:_(s8) = G_PTRTOINT %ptr
74 RET_ReallyLR implicit $b0
81 ; CHECK-LABEL: name: p0_s1
84 ; CHECK-NEXT: %ptr:_(p0) = COPY $x0
85 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT %ptr(p0)
86 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
87 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[PTRTOINT]](s64)
88 ; CHECK-NEXT: %ext:_(s32) = G_AND [[TRUNC]], [[C]]
89 ; CHECK-NEXT: $w0 = COPY %ext(s32)
90 ; CHECK-NEXT: RET_ReallyLR implicit $w0
92 %int:_(s1) = G_PTRTOINT %ptr
93 %ext:_(s32) = G_ZEXT %int
95 RET_ReallyLR implicit $w0
102 ; CHECK-LABEL: name: p0_s128
103 ; CHECK: liveins: $x0, $q0
105 ; CHECK-NEXT: %ptr:_(p0) = COPY $x0
106 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT %ptr(p0)
107 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
108 ; CHECK-NEXT: %int:_(s128) = G_MERGE_VALUES [[PTRTOINT]](s64), [[C]](s64)
109 ; CHECK-NEXT: $q0 = COPY %int(s128)
110 ; CHECK-NEXT: RET_ReallyLR implicit $q0
111 %ptr:_(p0) = COPY $x0
112 %int:_(s128) = G_PTRTOINT %ptr
114 RET_ReallyLR implicit $q0
121 ; CHECK-LABEL: name: p0_s88
122 ; CHECK: liveins: $x0
124 ; CHECK-NEXT: %ptr:_(p0) = COPY $x0
125 ; CHECK-NEXT: [[PTRTOINT:%[0-9]+]]:_(s64) = G_PTRTOINT %ptr(p0)
126 ; CHECK-NEXT: %trunc:_(s32) = G_TRUNC [[PTRTOINT]](s64)
127 ; CHECK-NEXT: $w0 = COPY %trunc(s32)
128 ; CHECK-NEXT: RET_ReallyLR implicit $w0
129 %ptr:_(p0) = COPY $x0
130 %int:_(s88) = G_PTRTOINT %ptr
131 %trunc:_(s32) = G_TRUNC %int
133 RET_ReallyLR implicit $w0
137 name: v2s64_v2p0_legal
138 tracksRegLiveness: true
143 ; CHECK-LABEL: name: v2s64_v2p0_legal
144 ; CHECK: liveins: $q0
146 ; CHECK-NEXT: %ptr:_(<2 x p0>) = COPY $q0
147 ; CHECK-NEXT: %int:_(<2 x s64>) = G_PTRTOINT %ptr(<2 x p0>)
148 ; CHECK-NEXT: $q0 = COPY %int(<2 x s64>)
149 ; CHECK-NEXT: RET_ReallyLR implicit $q0
150 %ptr:_(<2 x p0>) = COPY $q0
151 %int:_(<2 x s64>) = G_PTRTOINT %ptr(<2 x p0>)
152 $q0 = COPY %int(<2 x s64>)
153 RET_ReallyLR implicit $q0