1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -march=amdgcn -O0 -run-pass=legalizer -global-isel-abort=0 -o - %s | FileCheck %s 3 4--- 5name: test_inttoptr_s64_to_p0 6body: | 7 bb.0: 8 liveins: $vgpr0_vgpr1 9 10 ; CHECK-LABEL: name: test_inttoptr_s64_to_p0 11 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 12 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[COPY]](s64) 13 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p0) 14 %0:_(s64) = COPY $vgpr0_vgpr1 15 %1:_(p0) = G_INTTOPTR %0 16 $vgpr0_vgpr1 = COPY %1 17... 18 19--- 20name: test_inttoptr_s64_to_p1 21body: | 22 bb.0: 23 liveins: $vgpr0_vgpr1 24 25 ; CHECK-LABEL: name: test_inttoptr_s64_to_p1 26 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 27 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p1) = G_INTTOPTR [[COPY]](s64) 28 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p1) 29 %0:_(s64) = COPY $vgpr0_vgpr1 30 %1:_(p1) = G_INTTOPTR %0 31 $vgpr0_vgpr1 = COPY %1 32... 33 34--- 35name: test_inttoptr_s64_to_p4 36body: | 37 bb.0: 38 liveins: $vgpr0_vgpr1 39 40 ; CHECK-LABEL: name: test_inttoptr_s64_to_p4 41 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 42 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p4) = G_INTTOPTR [[COPY]](s64) 43 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p4) 44 %0:_(s64) = COPY $vgpr0_vgpr1 45 %1:_(p4) = G_INTTOPTR %0 46 $vgpr0_vgpr1 = COPY %1 47... 48 49--- 50name: test_inttoptr_s32_to_p3 51body: | 52 bb.0: 53 liveins: $vgpr0 54 55 ; CHECK-LABEL: name: test_inttoptr_s32_to_p3 56 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 57 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p3) = G_INTTOPTR [[COPY]](s32) 58 ; CHECK: $vgpr0 = COPY [[INTTOPTR]](p3) 59 %0:_(s32) = COPY $vgpr0 60 %1:_(p3) = G_INTTOPTR %0 61 $vgpr0 = COPY %1 62... 63 64--- 65name: test_inttoptr_s32_to_p5 66body: | 67 bb.0: 68 liveins: $vgpr0 69 70 ; CHECK-LABEL: name: test_inttoptr_s32_to_p5 71 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 72 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p5) = G_INTTOPTR [[COPY]](s32) 73 ; CHECK: $vgpr0 = COPY [[INTTOPTR]](p5) 74 %0:_(s32) = COPY $vgpr0 75 %1:_(p5) = G_INTTOPTR %0 76 $vgpr0 = COPY %1 77... 78 79--- 80name: test_inttoptr_s64_to_p999 81body: | 82 bb.0: 83 liveins: $vgpr0_vgpr1 84 85 ; CHECK-LABEL: name: test_inttoptr_s64_to_p999 86 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 87 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p999) = G_INTTOPTR [[COPY]](s64) 88 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p999) 89 %0:_(s64) = COPY $vgpr0_vgpr1 90 %1:_(p999) = G_INTTOPTR %0 91 $vgpr0_vgpr1 = COPY %1 92... 93 94--- 95name: test_inttoptr_s32_to_p0 96body: | 97 bb.0: 98 liveins: $vgpr0 99 100 ; CHECK-LABEL: name: test_inttoptr_s32_to_p0 101 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 102 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY]](s32) 103 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[ZEXT]](s64) 104 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p0) 105 %0:_(s32) = COPY $vgpr0 106 %1:_(p0) = G_INTTOPTR %0 107 $vgpr0_vgpr1 = COPY %1 108... 109 110--- 111name: test_inttoptr_s128_to_p0 112body: | 113 bb.0: 114 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 115 116 ; CHECK-LABEL: name: test_inttoptr_s128_to_p0 117 ; CHECK: [[COPY:%[0-9]+]]:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 118 ; CHECK: [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY]](s128) 119 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[TRUNC]](s64) 120 ; CHECK: $vgpr0_vgpr1 = COPY [[INTTOPTR]](p0) 121 %0:_(s128) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 122 %1:_(p0) = G_INTTOPTR %0 123 $vgpr0_vgpr1 = COPY %1 124... 125 126--- 127name: test_inttoptr_v2s64_to_v2p0 128body: | 129 bb.0: 130 liveins: $vgpr0_vgpr1_vgpr2_vgpr3 131 132 ; CHECK-LABEL: name: test_inttoptr_v2s64_to_v2p0 133 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 134 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>) 135 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[UV]](s64) 136 ; CHECK: [[INTTOPTR1:%[0-9]+]]:_(p0) = G_INTTOPTR [[UV1]](s64) 137 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[INTTOPTR]](p0), [[INTTOPTR1]](p0) 138 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>) 139 %0:_(<2 x s64>) = COPY $vgpr0_vgpr1_vgpr2_vgpr3 140 %1:_(<2 x p0>) = G_INTTOPTR %0 141 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1 142... 143 144--- 145name: test_inttoptr_v2s32_to_v2p0 146body: | 147 bb.0: 148 liveins: $vgpr0_vgpr1 149 150 ; CHECK-LABEL: name: test_inttoptr_v2s32_to_v2p0 151 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $vgpr0_vgpr1 152 ; CHECK: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>) 153 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[UV]](s32) 154 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[ZEXT]](s64) 155 ; CHECK: [[ZEXT1:%[0-9]+]]:_(s64) = G_ZEXT [[UV1]](s32) 156 ; CHECK: [[INTTOPTR1:%[0-9]+]]:_(p0) = G_INTTOPTR [[ZEXT1]](s64) 157 ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x p0>) = G_BUILD_VECTOR [[INTTOPTR]](p0), [[INTTOPTR1]](p0) 158 ; CHECK: $vgpr0_vgpr1_vgpr2_vgpr3 = COPY [[BUILD_VECTOR]](<2 x p0>) 159 %0:_(<2 x s32>) = COPY $vgpr0_vgpr1 160 %1:_(<2 x p0>) = G_INTTOPTR %0 161 $vgpr0_vgpr1_vgpr2_vgpr3 = COPY %1 162... 163 164--- 165name: test_inttoptr_s29_to_p3 166body: | 167 bb.0: 168 liveins: $vgpr0 169 170 ; CHECK-LABEL: name: test_inttoptr_s29_to_p3 171 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $vgpr0 172 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 536870911 173 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY [[COPY]](s32) 174 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] 175 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p3) = G_INTTOPTR [[AND]](s32) 176 ; CHECK: S_ENDPGM 0, implicit [[INTTOPTR]](p3) 177 %0:_(s32) = COPY $vgpr0 178 %1:_(s29) = G_TRUNC %0 179 %2:_(p3) = G_INTTOPTR %1 180 S_ENDPGM 0, implicit %2 181... 182 183--- 184name: test_inttoptr_s33_to_p3 185body: | 186 bb.0: 187 liveins: $vgpr0_vgpr1 188 189 ; CHECK-LABEL: name: test_inttoptr_s33_to_p3 190 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $vgpr0_vgpr1 191 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) 192 ; CHECK: [[INTTOPTR:%[0-9]+]]:_(p3) = G_INTTOPTR [[TRUNC]](s32) 193 ; CHECK: S_ENDPGM 0, implicit [[INTTOPTR]](p3) 194 %0:_(s64) = COPY $vgpr0_vgpr1 195 %1:_(s33) = G_TRUNC %0 196 %2:_(p3) = G_INTTOPTR %1 197 S_ENDPGM 0, implicit %2 198... 199