1# RUN: llc -mtriple=amdgcn--amdpal -mcpu=gfx803 -run-pass=simple-register-coalescing -o - %s | FileCheck -check-prefix=GCN %s 2 3# With one version of the D48102 fix, this test failed with 4# Assertion failed: (Id != S.end() && T != S.end() && T->valno == Id->valno), function pruneSubRegValues, file ../lib/CodeGen/RegisterCoalescer.cpp, line 2875. 5 6# GCN: {{^body}} 7 8--- | 9 target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5" 10 target triple = "amdgcn--amdpal" 11 12 ; Function Attrs: nounwind 13 define amdgpu_ps void @_amdgpu_ps_main(float %arg) #0 { 14 ret void 15 } 16 17 attributes #0 = { nounwind "InitialPSInputAddr"="3842" "target-cpu"="gfx803" } 18... 19 20--- 21name: _amdgpu_ps_main 22tracksRegLiveness: true 23body: | 24 bb.0: 25 successors: %bb.2(0x40000000), %bb.1(0x40000000) 26 %0:sreg_64 = COPY $exec 27 %1:sgpr_32 = S_MOV_B32 0 28 undef %2.sub0:sreg_128 = COPY %1 29 %2.sub1:sreg_128 = COPY %1 30 %2.sub2:sreg_128 = COPY %1 31 %2.sub3:sreg_128 = COPY %1 32 $exec = S_WQM_B64 $exec, implicit-def dead $scc 33 S_CBRANCH_SCC0 %bb.2, implicit undef $scc 34 35 bb.1: 36 successors: %bb.3(0x80000000) 37 %3:sreg_128 = COPY killed %2 38 %4:vreg_128 = COPY killed %3 39 %5:vreg_128 = COPY killed %4 40 S_BRANCH %bb.3 41 42 bb.2: 43 successors: %bb.4(0x80000000) 44 %6:vgpr_32 = V_MUL_F32_e32 1031798784, undef %7:vgpr_32, implicit $exec 45 %8:vgpr_32 = V_FLOOR_F32_e32 killed %6, implicit $exec 46 %9:vgpr_32 = V_ADD_F32_e32 0, killed %8, implicit $exec 47 %10:vgpr_32 = V_CVT_U32_F32_e32 killed %9, implicit $exec 48 %11:vgpr_32 = V_LSHLREV_B32_e32 1, killed %10, implicit $exec 49 %12:sreg_64 = S_MOV_B64 0 50 %13:sreg_128 = COPY killed %2 51 %14:vgpr_32 = V_MOV_B32_e32 0, implicit $exec 52 %15:vreg_128 = COPY killed %13 53 %16:sreg_64 = COPY killed %12 54 %17:vreg_128 = IMPLICIT_DEF 55 %18:vgpr_32 = COPY killed %14 56 %19:vreg_128 = COPY killed %15 57 S_BRANCH %bb.4 58 59 bb.3: 60 successors: %bb.17(0x80000000) 61 %20:vreg_128 = COPY killed %5 62 S_BRANCH %bb.17 63 64 bb.4: 65 successors: %bb.8(0x40000000), %bb.9(0x40000000) 66 %21:vreg_128 = COPY killed %19 67 %22:vgpr_32 = COPY killed %18 68 %23:vreg_128 = COPY killed %17 69 %24:sreg_64 = COPY killed %16 70 %25:vgpr_32 = V_OR_B32_e32 %22, %11, implicit $exec 71 %26:vreg_128 = BUFFER_LOAD_FORMAT_XYZW_IDXEN killed %25, undef %27:sreg_128, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 16 from constant-pool, align 1, addrspace 4) 72 %28:vgpr_32 = V_LSHRREV_B32_e32 30, killed %26.sub0, implicit $exec 73 %29:vreg_128 = COPY killed %21 74 %29.sub0:vreg_128 = COPY %1 75 %30:sreg_64 = V_CMP_NE_U32_e64 0, %28, implicit $exec 76 %31:sreg_64_xexec = V_CMP_EQ_U32_e64 0, %28, implicit $exec 77 dead %32:vgpr_32 = V_CNDMASK_B32_e64 0, -1, killed %31, implicit $exec 78 %33:vreg_128 = COPY %29 79 %33.sub1:vreg_128 = COPY undef %32 80 %34:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec 81 %35:vgpr_32 = V_MOV_B32_e32 0, implicit $exec 82 %36:sreg_64 = COPY %24 83 %37:vreg_128 = COPY %23 84 %38:vreg_128 = IMPLICIT_DEF 85 %39:vreg_128 = IMPLICIT_DEF 86 %40:vgpr_32 = IMPLICIT_DEF 87 %41:vreg_1 = COPY killed %35 88 %42:vreg_1 = COPY killed %34 89 %43:sreg_64 = COPY $exec, implicit-def $exec 90 %44:sreg_64 = S_AND_B64 %43, %30, implicit-def dead $scc 91 %45:sreg_64 = S_XOR_B64 %44, %43, implicit-def dead $scc 92 $exec = S_MOV_B64_term killed %44 93 SI_MASK_BRANCH %bb.9, implicit $exec 94 S_BRANCH %bb.8 95 96 bb.5: 97 successors: %bb.9(0x80000000) 98 $exec = S_OR_B64 $exec, %46, implicit-def $scc 99 %47:vreg_1 = COPY killed %48 100 %49:vgpr_32 = COPY killed %50 101 %51:vreg_128 = COPY killed %52 102 %53:vreg_128 = COPY killed %54 103 %55:sreg_64 = COPY killed %56 104 %57:sreg_64 = S_AND_B64 $exec, %46, implicit-def $scc 105 %57:sreg_64 = S_OR_B64 %57, killed %55, implicit-def $scc 106 %58:vgpr_32 = V_MOV_B32_e32 0, implicit $exec 107 %36:sreg_64 = COPY killed %57 108 %37:vreg_128 = COPY killed %53 109 %38:vreg_128 = COPY killed %59 110 %39:vreg_128 = COPY killed %51 111 %40:vgpr_32 = COPY killed %49 112 %41:vreg_1 = COPY killed %47 113 %42:vreg_1 = COPY killed %58 114 S_BRANCH %bb.9 115 116 bb.6: 117 successors: %bb.7(0x40000000), %bb.13(0x40000000) 118 $exec = S_OR_B64 $exec, killed %60, implicit-def $scc 119 %61:sreg_64 = V_CMP_NE_U32_e64 0, killed %62, implicit $exec 120 %63:vreg_128 = COPY killed %64 121 %65:vreg_1 = COPY killed %66 122 %67:sreg_64 = COPY $exec, implicit-def $exec 123 %68:sreg_64 = S_AND_B64 %67, %61, implicit-def dead $scc 124 $exec = S_MOV_B64_term killed %68 125 SI_MASK_BRANCH %bb.13, implicit $exec 126 S_BRANCH %bb.7 127 128 bb.7: 129 successors: %bb.13(0x80000000) 130 %69:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec 131 %70:vreg_128 = COPY killed %33 132 %63:vreg_128 = COPY killed %70 133 %65:vreg_1 = COPY killed %69 134 S_BRANCH %bb.13 135 136 bb.8: 137 successors: %bb.10(0x80000000) 138 %71:sreg_64 = S_MOV_B64 0 139 %72:vreg_128 = COPY %33 140 %73:sreg_64 = COPY killed %71 141 %74:vreg_128 = COPY killed %72 142 %75:vreg_128 = COPY killed %29 143 S_BRANCH %bb.10 144 145 bb.9: 146 successors: %bb.6(0x04000000), %bb.4(0x7c000000) 147 $exec = S_OR_B64 $exec, %45, implicit-def $scc 148 %62:vreg_1 = COPY killed %42 149 %66:vreg_1 = COPY killed %41 150 %76:vgpr_32 = COPY killed %40 151 %77:vreg_128 = COPY killed %39 152 %64:vreg_128 = COPY killed %38 153 %78:vreg_128 = COPY killed %37 154 %79:sreg_64 = COPY killed %36 155 %60:sreg_64 = S_AND_B64 $exec, %45, implicit-def $scc 156 %60:sreg_64 = S_OR_B64 %60, killed %79, implicit-def $scc 157 %80:vreg_128 = COPY %78 158 %16:sreg_64 = COPY %60 159 %17:vreg_128 = COPY killed %80 160 %18:vgpr_32 = COPY killed %76 161 %19:vreg_128 = COPY killed %77 162 $exec = S_ANDN2_B64_term $exec, %60 163 S_CBRANCH_EXECNZ %bb.4, implicit $exec 164 S_BRANCH %bb.6 165 166 bb.10: 167 successors: %bb.11(0x80000000) 168 %81:vreg_128 = COPY killed %75 169 %82:vreg_128 = COPY killed %74 170 %83:sreg_64 = COPY killed %73 171 172 bb.11: 173 successors: %bb.12(0x04000000), %bb.10(0x7c000000) 174 undef %59.sub0:vreg_128 = COPY %81.sub0 175 %59.sub2:vreg_128 = COPY %82.sub2 176 %59.sub3:vreg_128 = COPY killed %82.sub3 177 %84:sreg_64 = V_CMP_GE_U32_e64 killed %81.sub0, %28, implicit $exec 178 %85:sreg_64 = S_OR_B64 killed %84, killed %83, implicit-def $scc 179 %86:vreg_128 = COPY %59 180 %73:sreg_64 = COPY %85 181 %74:vreg_128 = COPY %59 182 %75:vreg_128 = COPY killed %86 183 $exec = S_ANDN2_B64_term $exec, %85 184 S_CBRANCH_EXECNZ %bb.10, implicit $exec 185 S_BRANCH %bb.12 186 187 bb.12: 188 successors: %bb.15(0x40000000), %bb.5(0x40000000) 189 $exec = S_OR_B64 $exec, killed %85, implicit-def $scc 190 %87:sreg_64 = V_CMP_LT_U32_e64 11, killed %28, implicit $exec 191 %88:vgpr_32 = V_MOV_B32_e32 -1, implicit $exec 192 %56:sreg_64 = COPY %24 193 %54:vreg_128 = COPY killed %23 194 %52:vreg_128 = IMPLICIT_DEF 195 %50:vgpr_32 = IMPLICIT_DEF 196 %48:vreg_1 = COPY killed %88 197 %89:sreg_64 = COPY $exec, implicit-def $exec 198 %90:sreg_64 = S_AND_B64 %89, %87, implicit-def dead $scc 199 %46:sreg_64 = S_XOR_B64 %90, %89, implicit-def dead $scc 200 $exec = S_MOV_B64_term killed %90 201 SI_MASK_BRANCH %bb.5, implicit $exec 202 S_BRANCH %bb.15 203 204 bb.13: 205 successors: %bb.14(0x40000000), %bb.16(0x40000000) 206 $exec = S_OR_B64 $exec, killed %67, implicit-def $scc 207 %91:vreg_1 = COPY killed %65 208 %92:vreg_128 = COPY killed %63 209 %93:sreg_64 = V_CMP_NE_U32_e64 0, killed %91, implicit $exec 210 %94:vreg_128 = COPY killed %78 211 %95:sreg_64 = COPY $exec, implicit-def $exec 212 %96:sreg_64 = S_AND_B64 %95, %93, implicit-def dead $scc 213 $exec = S_MOV_B64_term killed %96 214 SI_MASK_BRANCH %bb.16, implicit $exec 215 S_BRANCH %bb.14 216 217 bb.14: 218 successors: %bb.16(0x80000000) 219 %97:vreg_128 = COPY killed %92 220 %94:vreg_128 = COPY killed %97 221 S_BRANCH %bb.16 222 223 bb.15: 224 successors: %bb.5(0x80000000) 225 %98:vgpr_32 = V_MOV_B32_e32 0, implicit $exec 226 %99:sreg_64 = V_CMP_NE_U32_e64 0, killed %22, implicit $exec 227 %100:sreg_64 = S_OR_B64 killed %99, killed %24, implicit-def $scc 228 %101:vreg_128 = COPY %59 229 %102:vgpr_32 = V_MOV_B32_e32 1, implicit $exec 230 %56:sreg_64 = COPY killed %100 231 %54:vreg_128 = COPY killed %101 232 %52:vreg_128 = COPY %59 233 %50:vgpr_32 = COPY killed %102 234 %48:vreg_1 = COPY killed %98 235 S_BRANCH %bb.5 236 237 bb.16: 238 successors: %bb.3(0x80000000) 239 $exec = S_OR_B64 $exec, killed %95, implicit-def $scc 240 %103:vreg_128 = COPY killed %94 241 %104:vreg_128 = COPY killed %103 242 %5:vreg_128 = COPY killed %104 243 S_BRANCH %bb.3 244 245 bb.17: 246 %105:vgpr_32 = V_ADD_F32_e32 target-flags(amdgpu-rel32-lo) 0, %20.sub3, implicit $exec 247 %106:vgpr_32 = V_ADD_F32_e32 target-flags(amdgpu-gotprel32-hi) 0, killed %20.sub2, implicit $exec 248 undef %107.sub0:vreg_64 = COPY killed %106 249 %107.sub1:vreg_64 = COPY killed %105 250 $exec = S_AND_B64 $exec, killed %0, implicit-def dead $scc 251 %108:sreg_32_xm0 = S_MOV_B32 0 252 undef %109.sub0:sreg_256 = COPY %108 253 %109.sub1:sreg_256 = COPY %108 254 %109.sub2:sreg_256 = COPY %108 255 %109.sub3:sreg_256 = COPY %108 256 %109.sub4:sreg_256 = COPY %108 257 %109.sub5:sreg_256 = COPY %108 258 %109.sub6:sreg_256 = COPY %108 259 %109.sub7:sreg_256 = COPY killed %108 260 %110:vgpr_32 = IMAGE_SAMPLE_V1_V2 killed %107, killed %109, undef %111:sreg_128, 8, 0, 0, 0, 0, 0, 0, 0, 0, implicit $exec :: (dereferenceable load 16 from constant-pool, addrspace 4) 261 %112:vgpr_32 = V_MUL_F32_e32 0, killed %110, implicit $exec 262 %113:vgpr_32 = V_MUL_F32_e32 0, killed %112, implicit $exec 263 %114:vgpr_32 = V_MAD_F32 0, killed %113, 0, 0, 0, 0, 0, 0, implicit $exec 264 %115:vgpr_32 = V_MAX_F32_e32 0, killed %114, implicit $exec 265 %116:vgpr_32 = V_CVT_PKRTZ_F16_F32_e64 0, killed %115, 0, 1065353216, 0, implicit $exec 266 EXP 0, undef %117:vgpr_32, killed %116, undef %118:vgpr_32, undef %119:vgpr_32, -1, -1, 15, implicit $exec 267 S_ENDPGM 268... 269