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
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 define void @zextload_s32_from_s16(i16 *%addr) { ret void }
8 define void @zextload_s32_from_s16_not_combined(i16 *%addr) { ret void }
10 define i64 @i32_to_i64(i32* %ptr) {
11 %ld = load i32, i32* %ptr, align 4
12 %val = zext i32 %ld to i64
16 define i64 @i16_to_i64(i16* %ptr) {
17 %ld = load i16, i16* %ptr, align 2
18 %val = zext i16 %ld to i64
22 define i64 @i8_to_i64(i8* %ptr) {
23 %ld = load i8, i8* %ptr, align 1
24 %val = zext i8 %ld to i64
28 define i32 @i8_to_i32(i8* %ptr) {
29 %ld = load i8, i8* %ptr, align 1
30 %val = zext i8 %ld to i32
34 define i32 @i16_to_i32(i16* %ptr) {
35 %ld = load i16, i16* %ptr, align 2
36 %val = zext i16 %ld to i32
43 name: zextload_s32_from_s16
51 ; CHECK-LABEL: name: zextload_s32_from_s16
52 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
53 ; CHECK: [[LDRHHui:%[0-9]+]]:gpr32 = LDRHHui [[COPY]], 0 :: (load 2 from %ir.addr)
54 ; CHECK: $w0 = COPY [[LDRHHui]]
56 %1:gpr(s32) = G_ZEXTLOAD %0 :: (load 2 from %ir.addr)
60 name: zextload_s32_from_s16_not_combined
68 ; CHECK-LABEL: name: zextload_s32_from_s16_not_combined
69 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
70 ; CHECK: [[LDRHHui:%[0-9]+]]:gpr32 = LDRHHui [[COPY]], 0 :: (load 2 from %ir.addr)
71 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[LDRHHui]]
72 ; CHECK: $w0 = COPY [[COPY1]]
74 %1:gpr(s16) = G_LOAD %0 :: (load 2 from %ir.addr)
75 %2:gpr(s32) = G_ZEXT %1
86 ; CHECK-LABEL: name: i32_to_i64
87 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
88 ; CHECK: [[LDRWui:%[0-9]+]]:gpr32 = LDRWui [[COPY]], 0 :: (load 4 from %ir.ptr)
89 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64all = SUBREG_TO_REG 0, [[LDRWui]], %subreg.sub_32
90 ; CHECK: $x0 = COPY [[SUBREG_TO_REG]]
91 ; CHECK: RET_ReallyLR implicit $x0
93 %2:gpr(s64) = G_ZEXTLOAD %0(p0) :: (load 4 from %ir.ptr)
95 RET_ReallyLR implicit $x0
101 regBankSelected: true
106 ; CHECK-LABEL: name: i16_to_i64
107 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
108 ; CHECK: [[LDRHHui:%[0-9]+]]:gpr32 = LDRHHui [[COPY]], 0 :: (load 2 from %ir.ptr)
109 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64all = SUBREG_TO_REG 0, [[LDRHHui]], %subreg.sub_32
110 ; CHECK: $x0 = COPY [[SUBREG_TO_REG]]
111 ; CHECK: RET_ReallyLR implicit $x0
112 %0:gpr(p0) = COPY $x0
113 %2:gpr(s64) = G_ZEXTLOAD %0(p0) :: (load 2 from %ir.ptr)
115 RET_ReallyLR implicit $x0
121 regBankSelected: true
126 ; CHECK-LABEL: name: i8_to_i64
127 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
128 ; CHECK: [[LDRBBui:%[0-9]+]]:gpr32 = LDRBBui [[COPY]], 0 :: (load 1 from %ir.ptr)
129 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64all = SUBREG_TO_REG 0, [[LDRBBui]], %subreg.sub_32
130 ; CHECK: $x0 = COPY [[SUBREG_TO_REG]]
131 ; CHECK: RET_ReallyLR implicit $x0
132 %0:gpr(p0) = COPY $x0
133 %2:gpr(s64) = G_ZEXTLOAD %0(p0) :: (load 1 from %ir.ptr)
135 RET_ReallyLR implicit $x0
141 regBankSelected: true
146 ; CHECK-LABEL: name: i8_to_i32
147 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
148 ; CHECK: [[LDRBBui:%[0-9]+]]:gpr32 = LDRBBui [[COPY]], 0 :: (load 1 from %ir.ptr)
149 ; CHECK: $w0 = COPY [[LDRBBui]]
150 ; CHECK: RET_ReallyLR implicit $w0
151 %0:gpr(p0) = COPY $x0
152 %2:gpr(s32) = G_ZEXTLOAD %0(p0) :: (load 1 from %ir.ptr)
154 RET_ReallyLR implicit $w0
160 regBankSelected: true
165 ; CHECK-LABEL: name: i16_to_i32
166 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
167 ; CHECK: [[LDRHHui:%[0-9]+]]:gpr32 = LDRHHui [[COPY]], 0 :: (load 2 from %ir.ptr)
168 ; CHECK: $w0 = COPY [[LDRHHui]]
169 ; CHECK: RET_ReallyLR implicit $w0
170 %0:gpr(p0) = COPY $x0
171 %2:gpr(s32) = G_ZEXTLOAD %0(p0) :: (load 2 from %ir.ptr)
173 RET_ReallyLR implicit $w0