Tom Stellard | 859199d | 2013-11-27 21:23:29 +0000 | [diff] [blame^] | 1 | ; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck %s |
| 2 | |
| 3 | ; XXX: Enable when spilling is supported |
| 4 | ; XFAIL: * |
| 5 | |
| 6 | ; These tests check that the compiler won't crash when it needs to spill |
| 7 | ; SGPRs. |
| 8 | |
| 9 | ; CHECK-LABEL: @main |
| 10 | ; Writing to M0 from an SMRD instruction will hang the GPU. |
| 11 | ; CHECK-NOT: S_BUFFER_LOAD_DWORD m0 |
| 12 | ; CHECK: S_ENDPGM |
| 13 | @ddxy_lds = external addrspace(3) global [64 x i32] |
| 14 | |
| 15 | define void @main([17 x <16 x i8>] addrspace(2)* byval, [32 x <16 x i8>] addrspace(2)* byval, [16 x <32 x i8>] addrspace(2)* byval, float inreg, i32 inreg, <2 x i32>, <2 x i32>, <2 x i32>, <3 x i32>, <2 x i32>, <2 x i32>, <2 x i32>, float, float, float, float, float, float, float, float, float) #0 { |
| 16 | main_body: |
| 17 | %21 = getelementptr [17 x <16 x i8>] addrspace(2)* %0, i64 0, i32 0 |
| 18 | %22 = load <16 x i8> addrspace(2)* %21, !tbaa !0 |
| 19 | %23 = call float @llvm.SI.load.const(<16 x i8> %22, i32 96) |
| 20 | %24 = call float @llvm.SI.load.const(<16 x i8> %22, i32 100) |
| 21 | %25 = call float @llvm.SI.load.const(<16 x i8> %22, i32 104) |
| 22 | %26 = call float @llvm.SI.load.const(<16 x i8> %22, i32 112) |
| 23 | %27 = call float @llvm.SI.load.const(<16 x i8> %22, i32 116) |
| 24 | %28 = call float @llvm.SI.load.const(<16 x i8> %22, i32 120) |
| 25 | %29 = call float @llvm.SI.load.const(<16 x i8> %22, i32 128) |
| 26 | %30 = call float @llvm.SI.load.const(<16 x i8> %22, i32 132) |
| 27 | %31 = call float @llvm.SI.load.const(<16 x i8> %22, i32 140) |
| 28 | %32 = call float @llvm.SI.load.const(<16 x i8> %22, i32 144) |
| 29 | %33 = call float @llvm.SI.load.const(<16 x i8> %22, i32 160) |
| 30 | %34 = call float @llvm.SI.load.const(<16 x i8> %22, i32 176) |
| 31 | %35 = call float @llvm.SI.load.const(<16 x i8> %22, i32 180) |
| 32 | %36 = call float @llvm.SI.load.const(<16 x i8> %22, i32 184) |
| 33 | %37 = call float @llvm.SI.load.const(<16 x i8> %22, i32 192) |
| 34 | %38 = call float @llvm.SI.load.const(<16 x i8> %22, i32 196) |
| 35 | %39 = call float @llvm.SI.load.const(<16 x i8> %22, i32 200) |
| 36 | %40 = call float @llvm.SI.load.const(<16 x i8> %22, i32 208) |
| 37 | %41 = call float @llvm.SI.load.const(<16 x i8> %22, i32 212) |
| 38 | %42 = call float @llvm.SI.load.const(<16 x i8> %22, i32 216) |
| 39 | %43 = call float @llvm.SI.load.const(<16 x i8> %22, i32 224) |
| 40 | %44 = call float @llvm.SI.load.const(<16 x i8> %22, i32 240) |
| 41 | %45 = call float @llvm.SI.load.const(<16 x i8> %22, i32 244) |
| 42 | %46 = call float @llvm.SI.load.const(<16 x i8> %22, i32 248) |
| 43 | %47 = call float @llvm.SI.load.const(<16 x i8> %22, i32 256) |
| 44 | %48 = call float @llvm.SI.load.const(<16 x i8> %22, i32 272) |
| 45 | %49 = call float @llvm.SI.load.const(<16 x i8> %22, i32 276) |
| 46 | %50 = call float @llvm.SI.load.const(<16 x i8> %22, i32 280) |
| 47 | %51 = call float @llvm.SI.load.const(<16 x i8> %22, i32 288) |
| 48 | %52 = call float @llvm.SI.load.const(<16 x i8> %22, i32 292) |
| 49 | %53 = call float @llvm.SI.load.const(<16 x i8> %22, i32 296) |
| 50 | %54 = call float @llvm.SI.load.const(<16 x i8> %22, i32 304) |
| 51 | %55 = call float @llvm.SI.load.const(<16 x i8> %22, i32 308) |
| 52 | %56 = call float @llvm.SI.load.const(<16 x i8> %22, i32 312) |
| 53 | %57 = call float @llvm.SI.load.const(<16 x i8> %22, i32 368) |
| 54 | %58 = call float @llvm.SI.load.const(<16 x i8> %22, i32 372) |
| 55 | %59 = call float @llvm.SI.load.const(<16 x i8> %22, i32 376) |
| 56 | %60 = call float @llvm.SI.load.const(<16 x i8> %22, i32 384) |
| 57 | %61 = getelementptr [16 x <32 x i8>] addrspace(2)* %2, i64 0, i32 0 |
| 58 | %62 = load <32 x i8> addrspace(2)* %61, !tbaa !0 |
| 59 | %63 = getelementptr [32 x <16 x i8>] addrspace(2)* %1, i64 0, i32 0 |
| 60 | %64 = load <16 x i8> addrspace(2)* %63, !tbaa !0 |
| 61 | %65 = getelementptr [16 x <32 x i8>] addrspace(2)* %2, i64 0, i32 1 |
| 62 | %66 = load <32 x i8> addrspace(2)* %65, !tbaa !0 |
| 63 | %67 = getelementptr [32 x <16 x i8>] addrspace(2)* %1, i64 0, i32 1 |
| 64 | %68 = load <16 x i8> addrspace(2)* %67, !tbaa !0 |
| 65 | %69 = getelementptr [16 x <32 x i8>] addrspace(2)* %2, i64 0, i32 2 |
| 66 | %70 = load <32 x i8> addrspace(2)* %69, !tbaa !0 |
| 67 | %71 = getelementptr [32 x <16 x i8>] addrspace(2)* %1, i64 0, i32 2 |
| 68 | %72 = load <16 x i8> addrspace(2)* %71, !tbaa !0 |
| 69 | %73 = getelementptr [16 x <32 x i8>] addrspace(2)* %2, i64 0, i32 3 |
| 70 | %74 = load <32 x i8> addrspace(2)* %73, !tbaa !0 |
| 71 | %75 = getelementptr [32 x <16 x i8>] addrspace(2)* %1, i64 0, i32 3 |
| 72 | %76 = load <16 x i8> addrspace(2)* %75, !tbaa !0 |
| 73 | %77 = getelementptr [16 x <32 x i8>] addrspace(2)* %2, i64 0, i32 4 |
| 74 | %78 = load <32 x i8> addrspace(2)* %77, !tbaa !0 |
| 75 | %79 = getelementptr [32 x <16 x i8>] addrspace(2)* %1, i64 0, i32 4 |
| 76 | %80 = load <16 x i8> addrspace(2)* %79, !tbaa !0 |
| 77 | %81 = getelementptr [16 x <32 x i8>] addrspace(2)* %2, i64 0, i32 5 |
| 78 | %82 = load <32 x i8> addrspace(2)* %81, !tbaa !0 |
| 79 | %83 = getelementptr [32 x <16 x i8>] addrspace(2)* %1, i64 0, i32 5 |
| 80 | %84 = load <16 x i8> addrspace(2)* %83, !tbaa !0 |
| 81 | %85 = getelementptr [16 x <32 x i8>] addrspace(2)* %2, i64 0, i32 6 |
| 82 | %86 = load <32 x i8> addrspace(2)* %85, !tbaa !0 |
| 83 | %87 = getelementptr [32 x <16 x i8>] addrspace(2)* %1, i64 0, i32 6 |
| 84 | %88 = load <16 x i8> addrspace(2)* %87, !tbaa !0 |
| 85 | %89 = getelementptr [16 x <32 x i8>] addrspace(2)* %2, i64 0, i32 7 |
| 86 | %90 = load <32 x i8> addrspace(2)* %89, !tbaa !0 |
| 87 | %91 = getelementptr [32 x <16 x i8>] addrspace(2)* %1, i64 0, i32 7 |
| 88 | %92 = load <16 x i8> addrspace(2)* %91, !tbaa !0 |
| 89 | %93 = call float @llvm.SI.fs.interp(i32 0, i32 0, i32 %4, <2 x i32> %6) |
| 90 | %94 = call float @llvm.SI.fs.interp(i32 1, i32 0, i32 %4, <2 x i32> %6) |
| 91 | %95 = call float @llvm.SI.fs.interp(i32 0, i32 1, i32 %4, <2 x i32> %6) |
| 92 | %96 = call float @llvm.SI.fs.interp(i32 1, i32 1, i32 %4, <2 x i32> %6) |
| 93 | %97 = call float @llvm.SI.fs.interp(i32 2, i32 1, i32 %4, <2 x i32> %6) |
| 94 | %98 = call float @llvm.SI.fs.interp(i32 0, i32 2, i32 %4, <2 x i32> %6) |
| 95 | %99 = call float @llvm.SI.fs.interp(i32 1, i32 2, i32 %4, <2 x i32> %6) |
| 96 | %100 = call float @llvm.SI.fs.interp(i32 2, i32 2, i32 %4, <2 x i32> %6) |
| 97 | %101 = call float @llvm.SI.fs.interp(i32 0, i32 3, i32 %4, <2 x i32> %6) |
| 98 | %102 = call float @llvm.SI.fs.interp(i32 1, i32 3, i32 %4, <2 x i32> %6) |
| 99 | %103 = call float @llvm.SI.fs.interp(i32 2, i32 3, i32 %4, <2 x i32> %6) |
| 100 | %104 = call float @llvm.SI.fs.interp(i32 0, i32 4, i32 %4, <2 x i32> %6) |
| 101 | %105 = call float @llvm.SI.fs.interp(i32 1, i32 4, i32 %4, <2 x i32> %6) |
| 102 | %106 = call float @llvm.SI.fs.interp(i32 2, i32 4, i32 %4, <2 x i32> %6) |
| 103 | %107 = call float @llvm.SI.fs.interp(i32 0, i32 5, i32 %4, <2 x i32> %6) |
| 104 | %108 = call float @llvm.SI.fs.interp(i32 1, i32 5, i32 %4, <2 x i32> %6) |
| 105 | %109 = call float @llvm.SI.fs.interp(i32 2, i32 5, i32 %4, <2 x i32> %6) |
| 106 | %110 = call i32 @llvm.SI.tid() |
| 107 | %111 = getelementptr [64 x i32] addrspace(3)* @ddxy_lds, i32 0, i32 %110 |
| 108 | %112 = bitcast float %93 to i32 |
| 109 | store i32 %112, i32 addrspace(3)* %111 |
| 110 | %113 = bitcast float %94 to i32 |
| 111 | store i32 %113, i32 addrspace(3)* %111 |
| 112 | %114 = call i32 @llvm.SI.tid() |
| 113 | %115 = getelementptr [64 x i32] addrspace(3)* @ddxy_lds, i32 0, i32 %114 |
| 114 | %116 = and i32 %114, -4 |
| 115 | %117 = getelementptr [64 x i32] addrspace(3)* @ddxy_lds, i32 0, i32 %116 |
| 116 | %118 = add i32 %116, 1 |
| 117 | %119 = getelementptr [64 x i32] addrspace(3)* @ddxy_lds, i32 0, i32 %118 |
| 118 | %120 = bitcast float %93 to i32 |
| 119 | store i32 %120, i32 addrspace(3)* %115 |
| 120 | %121 = load i32 addrspace(3)* %117 |
| 121 | %122 = bitcast i32 %121 to float |
| 122 | %123 = load i32 addrspace(3)* %119 |
| 123 | %124 = bitcast i32 %123 to float |
| 124 | %125 = fsub float %124, %122 |
| 125 | %126 = bitcast float %94 to i32 |
| 126 | store i32 %126, i32 addrspace(3)* %115 |
| 127 | %127 = load i32 addrspace(3)* %117 |
| 128 | %128 = bitcast i32 %127 to float |
| 129 | %129 = load i32 addrspace(3)* %119 |
| 130 | %130 = bitcast i32 %129 to float |
| 131 | %131 = fsub float %130, %128 |
| 132 | %132 = insertelement <4 x float> undef, float %125, i32 0 |
| 133 | %133 = insertelement <4 x float> %132, float %131, i32 1 |
| 134 | %134 = insertelement <4 x float> %133, float %131, i32 2 |
| 135 | %135 = insertelement <4 x float> %134, float %131, i32 3 |
| 136 | %136 = extractelement <4 x float> %135, i32 0 |
| 137 | %137 = extractelement <4 x float> %135, i32 1 |
| 138 | %138 = fmul float %60, %93 |
| 139 | %139 = fmul float %60, %94 |
| 140 | %140 = fmul float %60, %94 |
| 141 | %141 = fmul float %60, %94 |
| 142 | %142 = call i32 @llvm.SI.tid() |
| 143 | %143 = getelementptr [64 x i32] addrspace(3)* @ddxy_lds, i32 0, i32 %142 |
| 144 | %144 = bitcast float %138 to i32 |
| 145 | store i32 %144, i32 addrspace(3)* %143 |
| 146 | %145 = bitcast float %139 to i32 |
| 147 | store i32 %145, i32 addrspace(3)* %143 |
| 148 | %146 = bitcast float %140 to i32 |
| 149 | store i32 %146, i32 addrspace(3)* %143 |
| 150 | %147 = bitcast float %141 to i32 |
| 151 | store i32 %147, i32 addrspace(3)* %143 |
| 152 | %148 = call i32 @llvm.SI.tid() |
| 153 | %149 = getelementptr [64 x i32] addrspace(3)* @ddxy_lds, i32 0, i32 %148 |
| 154 | %150 = and i32 %148, -4 |
| 155 | %151 = getelementptr [64 x i32] addrspace(3)* @ddxy_lds, i32 0, i32 %150 |
| 156 | %152 = add i32 %150, 2 |
| 157 | %153 = getelementptr [64 x i32] addrspace(3)* @ddxy_lds, i32 0, i32 %152 |
| 158 | %154 = bitcast float %138 to i32 |
| 159 | store i32 %154, i32 addrspace(3)* %149 |
| 160 | %155 = load i32 addrspace(3)* %151 |
| 161 | %156 = bitcast i32 %155 to float |
| 162 | %157 = load i32 addrspace(3)* %153 |
| 163 | %158 = bitcast i32 %157 to float |
| 164 | %159 = fsub float %158, %156 |
| 165 | %160 = bitcast float %139 to i32 |
| 166 | store i32 %160, i32 addrspace(3)* %149 |
| 167 | %161 = load i32 addrspace(3)* %151 |
| 168 | %162 = bitcast i32 %161 to float |
| 169 | %163 = load i32 addrspace(3)* %153 |
| 170 | %164 = bitcast i32 %163 to float |
| 171 | %165 = fsub float %164, %162 |
| 172 | %166 = bitcast float %140 to i32 |
| 173 | store i32 %166, i32 addrspace(3)* %149 |
| 174 | %167 = load i32 addrspace(3)* %151 |
| 175 | %168 = bitcast i32 %167 to float |
| 176 | %169 = load i32 addrspace(3)* %153 |
| 177 | %170 = bitcast i32 %169 to float |
| 178 | %171 = fsub float %170, %168 |
| 179 | %172 = bitcast float %141 to i32 |
| 180 | store i32 %172, i32 addrspace(3)* %149 |
| 181 | %173 = load i32 addrspace(3)* %151 |
| 182 | %174 = bitcast i32 %173 to float |
| 183 | %175 = load i32 addrspace(3)* %153 |
| 184 | %176 = bitcast i32 %175 to float |
| 185 | %177 = fsub float %176, %174 |
| 186 | %178 = insertelement <4 x float> undef, float %159, i32 0 |
| 187 | %179 = insertelement <4 x float> %178, float %165, i32 1 |
| 188 | %180 = insertelement <4 x float> %179, float %171, i32 2 |
| 189 | %181 = insertelement <4 x float> %180, float %177, i32 3 |
| 190 | %182 = extractelement <4 x float> %181, i32 0 |
| 191 | %183 = extractelement <4 x float> %181, i32 1 |
| 192 | %184 = fdiv float 1.000000e+00, %97 |
| 193 | %185 = fmul float %33, %184 |
| 194 | %186 = fcmp uge float 1.000000e+00, %185 |
| 195 | %187 = select i1 %186, float %185, float 1.000000e+00 |
| 196 | %188 = fmul float %187, %30 |
| 197 | %189 = call float @ceil(float %188) |
| 198 | %190 = fcmp uge float 3.000000e+00, %189 |
| 199 | %191 = select i1 %190, float 3.000000e+00, float %189 |
| 200 | %192 = fdiv float 1.000000e+00, %191 |
| 201 | %193 = fdiv float 1.000000e+00, %30 |
| 202 | %194 = fmul float %191, %193 |
| 203 | %195 = fmul float %31, %194 |
| 204 | %196 = fmul float %95, %95 |
| 205 | %197 = fmul float %96, %96 |
| 206 | %198 = fadd float %197, %196 |
| 207 | %199 = fmul float %97, %97 |
| 208 | %200 = fadd float %198, %199 |
| 209 | %201 = call float @llvm.AMDGPU.rsq(float %200) |
| 210 | %202 = fmul float %95, %201 |
| 211 | %203 = fmul float %96, %201 |
| 212 | %204 = fmul float %202, %29 |
| 213 | %205 = fmul float %203, %29 |
| 214 | %206 = fmul float %204, -1.000000e+00 |
| 215 | %207 = fmul float %205, 1.000000e+00 |
| 216 | %208 = fmul float %206, %32 |
| 217 | %209 = fmul float %207, %32 |
| 218 | %210 = fsub float -0.000000e+00, %208 |
| 219 | %211 = fadd float %93, %210 |
| 220 | %212 = fsub float -0.000000e+00, %209 |
| 221 | %213 = fadd float %94, %212 |
| 222 | %214 = fmul float %206, %192 |
| 223 | %215 = fmul float %207, %192 |
| 224 | %216 = fmul float -1.000000e+00, %192 |
| 225 | %217 = bitcast float %136 to i32 |
| 226 | %218 = bitcast float %182 to i32 |
| 227 | %219 = bitcast float %137 to i32 |
| 228 | %220 = bitcast float %183 to i32 |
| 229 | %221 = insertelement <8 x i32> undef, i32 %217, i32 0 |
| 230 | %222 = insertelement <8 x i32> %221, i32 %218, i32 1 |
| 231 | %223 = insertelement <8 x i32> %222, i32 %219, i32 2 |
| 232 | %224 = insertelement <8 x i32> %223, i32 %220, i32 3 |
| 233 | br label %LOOP |
| 234 | |
| 235 | LOOP: ; preds = %ENDIF, %main_body |
| 236 | %temp24.0 = phi float [ 1.000000e+00, %main_body ], [ %258, %ENDIF ] |
| 237 | %temp28.0 = phi float [ %211, %main_body ], [ %253, %ENDIF ] |
| 238 | %temp29.0 = phi float [ %213, %main_body ], [ %255, %ENDIF ] |
| 239 | %temp30.0 = phi float [ 1.000000e+00, %main_body ], [ %257, %ENDIF ] |
| 240 | %225 = fcmp oge float %temp24.0, %191 |
| 241 | %226 = sext i1 %225 to i32 |
| 242 | %227 = bitcast i32 %226 to float |
| 243 | %228 = bitcast float %227 to i32 |
| 244 | %229 = icmp ne i32 %228, 0 |
| 245 | br i1 %229, label %IF, label %ENDIF |
| 246 | |
| 247 | IF: ; preds = %LOOP |
| 248 | %230 = bitcast float %136 to i32 |
| 249 | %231 = bitcast float %182 to i32 |
| 250 | %232 = bitcast float %137 to i32 |
| 251 | %233 = bitcast float %183 to i32 |
| 252 | %234 = insertelement <8 x i32> undef, i32 %230, i32 0 |
| 253 | %235 = insertelement <8 x i32> %234, i32 %231, i32 1 |
| 254 | %236 = insertelement <8 x i32> %235, i32 %232, i32 2 |
| 255 | %237 = insertelement <8 x i32> %236, i32 %233, i32 3 |
| 256 | br label %LOOP65 |
| 257 | |
| 258 | ENDIF: ; preds = %LOOP |
| 259 | %238 = bitcast float %temp28.0 to i32 |
| 260 | %239 = bitcast float %temp29.0 to i32 |
| 261 | %240 = insertelement <8 x i32> %224, i32 %238, i32 4 |
| 262 | %241 = insertelement <8 x i32> %240, i32 %239, i32 5 |
| 263 | %242 = insertelement <8 x i32> %241, i32 undef, i32 6 |
| 264 | %243 = insertelement <8 x i32> %242, i32 undef, i32 7 |
| 265 | %244 = call <4 x float> @llvm.SI.sampled.v8i32(<8 x i32> %243, <32 x i8> %62, <16 x i8> %64, i32 2) |
| 266 | %245 = extractelement <4 x float> %244, i32 3 |
| 267 | %246 = fcmp oge float %temp30.0, %245 |
| 268 | %247 = sext i1 %246 to i32 |
| 269 | %248 = bitcast i32 %247 to float |
| 270 | %249 = bitcast float %248 to i32 |
| 271 | %250 = and i32 %249, 1065353216 |
| 272 | %251 = bitcast i32 %250 to float |
| 273 | %252 = fmul float %214, %251 |
| 274 | %253 = fadd float %252, %temp28.0 |
| 275 | %254 = fmul float %215, %251 |
| 276 | %255 = fadd float %254, %temp29.0 |
| 277 | %256 = fmul float %216, %251 |
| 278 | %257 = fadd float %256, %temp30.0 |
| 279 | %258 = fadd float %temp24.0, 1.000000e+00 |
| 280 | br label %LOOP |
| 281 | |
| 282 | LOOP65: ; preds = %ENDIF66, %IF |
| 283 | %temp24.1 = phi float [ 0.000000e+00, %IF ], [ %610, %ENDIF66 ] |
| 284 | %temp28.1 = phi float [ %temp28.0, %IF ], [ %605, %ENDIF66 ] |
| 285 | %temp29.1 = phi float [ %temp29.0, %IF ], [ %607, %ENDIF66 ] |
| 286 | %temp30.1 = phi float [ %temp30.0, %IF ], [ %609, %ENDIF66 ] |
| 287 | %temp32.0 = phi float [ 1.000000e+00, %IF ], [ %611, %ENDIF66 ] |
| 288 | %259 = fcmp oge float %temp24.1, %195 |
| 289 | %260 = sext i1 %259 to i32 |
| 290 | %261 = bitcast i32 %260 to float |
| 291 | %262 = bitcast float %261 to i32 |
| 292 | %263 = icmp ne i32 %262, 0 |
| 293 | br i1 %263, label %IF67, label %ENDIF66 |
| 294 | |
| 295 | IF67: ; preds = %LOOP65 |
| 296 | %264 = bitcast float %136 to i32 |
| 297 | %265 = bitcast float %182 to i32 |
| 298 | %266 = bitcast float %137 to i32 |
| 299 | %267 = bitcast float %183 to i32 |
| 300 | %268 = bitcast float %temp28.1 to i32 |
| 301 | %269 = bitcast float %temp29.1 to i32 |
| 302 | %270 = insertelement <8 x i32> undef, i32 %264, i32 0 |
| 303 | %271 = insertelement <8 x i32> %270, i32 %265, i32 1 |
| 304 | %272 = insertelement <8 x i32> %271, i32 %266, i32 2 |
| 305 | %273 = insertelement <8 x i32> %272, i32 %267, i32 3 |
| 306 | %274 = insertelement <8 x i32> %273, i32 %268, i32 4 |
| 307 | %275 = insertelement <8 x i32> %274, i32 %269, i32 5 |
| 308 | %276 = insertelement <8 x i32> %275, i32 undef, i32 6 |
| 309 | %277 = insertelement <8 x i32> %276, i32 undef, i32 7 |
| 310 | %278 = call <4 x float> @llvm.SI.sampled.v8i32(<8 x i32> %277, <32 x i8> %66, <16 x i8> %68, i32 2) |
| 311 | %279 = extractelement <4 x float> %278, i32 0 |
| 312 | %280 = extractelement <4 x float> %278, i32 1 |
| 313 | %281 = extractelement <4 x float> %278, i32 2 |
| 314 | %282 = extractelement <4 x float> %278, i32 3 |
| 315 | %283 = fmul float %282, %47 |
| 316 | %284 = bitcast float %136 to i32 |
| 317 | %285 = bitcast float %182 to i32 |
| 318 | %286 = bitcast float %137 to i32 |
| 319 | %287 = bitcast float %183 to i32 |
| 320 | %288 = bitcast float %temp28.1 to i32 |
| 321 | %289 = bitcast float %temp29.1 to i32 |
| 322 | %290 = insertelement <8 x i32> undef, i32 %284, i32 0 |
| 323 | %291 = insertelement <8 x i32> %290, i32 %285, i32 1 |
| 324 | %292 = insertelement <8 x i32> %291, i32 %286, i32 2 |
| 325 | %293 = insertelement <8 x i32> %292, i32 %287, i32 3 |
| 326 | %294 = insertelement <8 x i32> %293, i32 %288, i32 4 |
| 327 | %295 = insertelement <8 x i32> %294, i32 %289, i32 5 |
| 328 | %296 = insertelement <8 x i32> %295, i32 undef, i32 6 |
| 329 | %297 = insertelement <8 x i32> %296, i32 undef, i32 7 |
| 330 | %298 = call <4 x float> @llvm.SI.sampled.v8i32(<8 x i32> %297, <32 x i8> %82, <16 x i8> %84, i32 2) |
| 331 | %299 = extractelement <4 x float> %298, i32 0 |
| 332 | %300 = extractelement <4 x float> %298, i32 1 |
| 333 | %301 = extractelement <4 x float> %298, i32 2 |
| 334 | %302 = bitcast float %136 to i32 |
| 335 | %303 = bitcast float %182 to i32 |
| 336 | %304 = bitcast float %137 to i32 |
| 337 | %305 = bitcast float %183 to i32 |
| 338 | %306 = bitcast float %temp28.1 to i32 |
| 339 | %307 = bitcast float %temp29.1 to i32 |
| 340 | %308 = insertelement <8 x i32> undef, i32 %302, i32 0 |
| 341 | %309 = insertelement <8 x i32> %308, i32 %303, i32 1 |
| 342 | %310 = insertelement <8 x i32> %309, i32 %304, i32 2 |
| 343 | %311 = insertelement <8 x i32> %310, i32 %305, i32 3 |
| 344 | %312 = insertelement <8 x i32> %311, i32 %306, i32 4 |
| 345 | %313 = insertelement <8 x i32> %312, i32 %307, i32 5 |
| 346 | %314 = insertelement <8 x i32> %313, i32 undef, i32 6 |
| 347 | %315 = insertelement <8 x i32> %314, i32 undef, i32 7 |
| 348 | %316 = call <4 x float> @llvm.SI.sampled.v8i32(<8 x i32> %315, <32 x i8> %78, <16 x i8> %80, i32 2) |
| 349 | %317 = extractelement <4 x float> %316, i32 0 |
| 350 | %318 = extractelement <4 x float> %316, i32 1 |
| 351 | %319 = extractelement <4 x float> %316, i32 2 |
| 352 | %320 = fmul float %317, %23 |
| 353 | %321 = fmul float %318, %24 |
| 354 | %322 = fmul float %319, %25 |
| 355 | %323 = fmul float %299, %26 |
| 356 | %324 = fadd float %323, %320 |
| 357 | %325 = fmul float %300, %27 |
| 358 | %326 = fadd float %325, %321 |
| 359 | %327 = fmul float %301, %28 |
| 360 | %328 = fadd float %327, %322 |
| 361 | %329 = fadd float %279, %324 |
| 362 | %330 = fadd float %280, %326 |
| 363 | %331 = fadd float %281, %328 |
| 364 | %332 = bitcast float %136 to i32 |
| 365 | %333 = bitcast float %182 to i32 |
| 366 | %334 = bitcast float %137 to i32 |
| 367 | %335 = bitcast float %183 to i32 |
| 368 | %336 = bitcast float %temp28.1 to i32 |
| 369 | %337 = bitcast float %temp29.1 to i32 |
| 370 | %338 = insertelement <8 x i32> undef, i32 %332, i32 0 |
| 371 | %339 = insertelement <8 x i32> %338, i32 %333, i32 1 |
| 372 | %340 = insertelement <8 x i32> %339, i32 %334, i32 2 |
| 373 | %341 = insertelement <8 x i32> %340, i32 %335, i32 3 |
| 374 | %342 = insertelement <8 x i32> %341, i32 %336, i32 4 |
| 375 | %343 = insertelement <8 x i32> %342, i32 %337, i32 5 |
| 376 | %344 = insertelement <8 x i32> %343, i32 undef, i32 6 |
| 377 | %345 = insertelement <8 x i32> %344, i32 undef, i32 7 |
| 378 | %346 = call <4 x float> @llvm.SI.sampled.v8i32(<8 x i32> %345, <32 x i8> %62, <16 x i8> %64, i32 2) |
| 379 | %347 = extractelement <4 x float> %346, i32 0 |
| 380 | %348 = extractelement <4 x float> %346, i32 1 |
| 381 | %349 = extractelement <4 x float> %346, i32 2 |
| 382 | %350 = fadd float %347, -5.000000e-01 |
| 383 | %351 = fadd float %348, -5.000000e-01 |
| 384 | %352 = fadd float %349, -5.000000e-01 |
| 385 | %353 = fmul float %350, %350 |
| 386 | %354 = fmul float %351, %351 |
| 387 | %355 = fadd float %354, %353 |
| 388 | %356 = fmul float %352, %352 |
| 389 | %357 = fadd float %355, %356 |
| 390 | %358 = call float @llvm.AMDGPU.rsq(float %357) |
| 391 | %359 = fmul float %350, %358 |
| 392 | %360 = fmul float %351, %358 |
| 393 | %361 = fmul float %352, %358 |
| 394 | %362 = bitcast float %136 to i32 |
| 395 | %363 = bitcast float %182 to i32 |
| 396 | %364 = bitcast float %137 to i32 |
| 397 | %365 = bitcast float %183 to i32 |
| 398 | %366 = bitcast float %temp28.1 to i32 |
| 399 | %367 = bitcast float %temp29.1 to i32 |
| 400 | %368 = insertelement <8 x i32> undef, i32 %362, i32 0 |
| 401 | %369 = insertelement <8 x i32> %368, i32 %363, i32 1 |
| 402 | %370 = insertelement <8 x i32> %369, i32 %364, i32 2 |
| 403 | %371 = insertelement <8 x i32> %370, i32 %365, i32 3 |
| 404 | %372 = insertelement <8 x i32> %371, i32 %366, i32 4 |
| 405 | %373 = insertelement <8 x i32> %372, i32 %367, i32 5 |
| 406 | %374 = insertelement <8 x i32> %373, i32 undef, i32 6 |
| 407 | %375 = insertelement <8 x i32> %374, i32 undef, i32 7 |
| 408 | %376 = call <4 x float> @llvm.SI.sampled.v8i32(<8 x i32> %375, <32 x i8> %70, <16 x i8> %72, i32 2) |
| 409 | %377 = extractelement <4 x float> %376, i32 0 |
| 410 | %378 = extractelement <4 x float> %376, i32 1 |
| 411 | %379 = extractelement <4 x float> %376, i32 2 |
| 412 | %380 = extractelement <4 x float> %376, i32 3 |
| 413 | %381 = fsub float -0.000000e+00, %95 |
| 414 | %382 = fsub float -0.000000e+00, %96 |
| 415 | %383 = fsub float -0.000000e+00, %97 |
| 416 | %384 = fmul float %359, %381 |
| 417 | %385 = fmul float %360, %382 |
| 418 | %386 = fadd float %385, %384 |
| 419 | %387 = fmul float %361, %383 |
| 420 | %388 = fadd float %386, %387 |
| 421 | %389 = fmul float %388, %359 |
| 422 | %390 = fmul float %388, %360 |
| 423 | %391 = fmul float %388, %361 |
| 424 | %392 = fmul float 2.000000e+00, %389 |
| 425 | %393 = fmul float 2.000000e+00, %390 |
| 426 | %394 = fmul float 2.000000e+00, %391 |
| 427 | %395 = fsub float -0.000000e+00, %392 |
| 428 | %396 = fadd float %381, %395 |
| 429 | %397 = fsub float -0.000000e+00, %393 |
| 430 | %398 = fadd float %382, %397 |
| 431 | %399 = fsub float -0.000000e+00, %394 |
| 432 | %400 = fadd float %383, %399 |
| 433 | %401 = fmul float %396, %98 |
| 434 | %402 = fmul float %396, %99 |
| 435 | %403 = fmul float %396, %100 |
| 436 | %404 = fmul float %398, %101 |
| 437 | %405 = fadd float %404, %401 |
| 438 | %406 = fmul float %398, %102 |
| 439 | %407 = fadd float %406, %402 |
| 440 | %408 = fmul float %398, %103 |
| 441 | %409 = fadd float %408, %403 |
| 442 | %410 = fmul float %400, %104 |
| 443 | %411 = fadd float %410, %405 |
| 444 | %412 = fmul float %400, %105 |
| 445 | %413 = fadd float %412, %407 |
| 446 | %414 = fmul float %400, %106 |
| 447 | %415 = fadd float %414, %409 |
| 448 | %416 = bitcast float %136 to i32 |
| 449 | %417 = bitcast float %182 to i32 |
| 450 | %418 = bitcast float %137 to i32 |
| 451 | %419 = bitcast float %183 to i32 |
| 452 | %420 = bitcast float %temp28.1 to i32 |
| 453 | %421 = bitcast float %temp29.1 to i32 |
| 454 | %422 = insertelement <8 x i32> undef, i32 %416, i32 0 |
| 455 | %423 = insertelement <8 x i32> %422, i32 %417, i32 1 |
| 456 | %424 = insertelement <8 x i32> %423, i32 %418, i32 2 |
| 457 | %425 = insertelement <8 x i32> %424, i32 %419, i32 3 |
| 458 | %426 = insertelement <8 x i32> %425, i32 %420, i32 4 |
| 459 | %427 = insertelement <8 x i32> %426, i32 %421, i32 5 |
| 460 | %428 = insertelement <8 x i32> %427, i32 undef, i32 6 |
| 461 | %429 = insertelement <8 x i32> %428, i32 undef, i32 7 |
| 462 | %430 = call <4 x float> @llvm.SI.sampled.v8i32(<8 x i32> %429, <32 x i8> %86, <16 x i8> %88, i32 2) |
| 463 | %431 = extractelement <4 x float> %430, i32 0 |
| 464 | %432 = extractelement <4 x float> %430, i32 1 |
| 465 | %433 = extractelement <4 x float> %430, i32 2 |
| 466 | %434 = fmul float %48, %411 |
| 467 | %435 = fmul float %49, %411 |
| 468 | %436 = fmul float %50, %411 |
| 469 | %437 = fmul float %51, %413 |
| 470 | %438 = fadd float %437, %434 |
| 471 | %439 = fmul float %52, %413 |
| 472 | %440 = fadd float %439, %435 |
| 473 | %441 = fmul float %53, %413 |
| 474 | %442 = fadd float %441, %436 |
| 475 | %443 = fmul float %54, %415 |
| 476 | %444 = fadd float %443, %438 |
| 477 | %445 = fmul float %55, %415 |
| 478 | %446 = fadd float %445, %440 |
| 479 | %447 = fmul float %56, %415 |
| 480 | %448 = fadd float %447, %442 |
| 481 | %449 = insertelement <4 x float> undef, float %444, i32 0 |
| 482 | %450 = insertelement <4 x float> %449, float %446, i32 1 |
| 483 | %451 = insertelement <4 x float> %450, float %448, i32 2 |
| 484 | %452 = insertelement <4 x float> %451, float %195, i32 3 |
| 485 | %453 = call <4 x float> @llvm.AMDGPU.cube(<4 x float> %452) |
| 486 | %454 = extractelement <4 x float> %453, i32 0 |
| 487 | %455 = extractelement <4 x float> %453, i32 1 |
| 488 | %456 = extractelement <4 x float> %453, i32 2 |
| 489 | %457 = extractelement <4 x float> %453, i32 3 |
| 490 | %458 = call float @fabs(float %456) |
| 491 | %459 = fdiv float 1.000000e+00, %458 |
| 492 | %460 = fmul float %454, %459 |
| 493 | %461 = fadd float %460, 1.500000e+00 |
| 494 | %462 = fmul float %455, %459 |
| 495 | %463 = fadd float %462, 1.500000e+00 |
| 496 | %464 = bitcast float %463 to i32 |
| 497 | %465 = bitcast float %461 to i32 |
| 498 | %466 = bitcast float %457 to i32 |
| 499 | %467 = insertelement <4 x i32> undef, i32 %464, i32 0 |
| 500 | %468 = insertelement <4 x i32> %467, i32 %465, i32 1 |
| 501 | %469 = insertelement <4 x i32> %468, i32 %466, i32 2 |
| 502 | %470 = insertelement <4 x i32> %469, i32 undef, i32 3 |
| 503 | %471 = call <4 x float> @llvm.SI.sample.v4i32(<4 x i32> %470, <32 x i8> %90, <16 x i8> %92, i32 4) |
| 504 | %472 = extractelement <4 x float> %471, i32 0 |
| 505 | %473 = extractelement <4 x float> %471, i32 1 |
| 506 | %474 = extractelement <4 x float> %471, i32 2 |
| 507 | %475 = fmul float %431, %472 |
| 508 | %476 = fadd float %475, %329 |
| 509 | %477 = fmul float %432, %473 |
| 510 | %478 = fadd float %477, %330 |
| 511 | %479 = fmul float %433, %474 |
| 512 | %480 = fadd float %479, %331 |
| 513 | %481 = fmul float %107, %107 |
| 514 | %482 = fmul float %108, %108 |
| 515 | %483 = fadd float %482, %481 |
| 516 | %484 = fmul float %109, %109 |
| 517 | %485 = fadd float %483, %484 |
| 518 | %486 = call float @llvm.AMDGPU.rsq(float %485) |
| 519 | %487 = fmul float %107, %486 |
| 520 | %488 = fmul float %108, %486 |
| 521 | %489 = fmul float %109, %486 |
| 522 | %490 = fmul float %377, %40 |
| 523 | %491 = fmul float %378, %41 |
| 524 | %492 = fmul float %379, %42 |
| 525 | %493 = fmul float %359, %487 |
| 526 | %494 = fmul float %360, %488 |
| 527 | %495 = fadd float %494, %493 |
| 528 | %496 = fmul float %361, %489 |
| 529 | %497 = fadd float %495, %496 |
| 530 | %498 = fmul float %497, %359 |
| 531 | %499 = fmul float %497, %360 |
| 532 | %500 = fmul float %497, %361 |
| 533 | %501 = fmul float 2.000000e+00, %498 |
| 534 | %502 = fmul float 2.000000e+00, %499 |
| 535 | %503 = fmul float 2.000000e+00, %500 |
| 536 | %504 = fsub float -0.000000e+00, %501 |
| 537 | %505 = fadd float %487, %504 |
| 538 | %506 = fsub float -0.000000e+00, %502 |
| 539 | %507 = fadd float %488, %506 |
| 540 | %508 = fsub float -0.000000e+00, %503 |
| 541 | %509 = fadd float %489, %508 |
| 542 | %510 = fmul float %95, %95 |
| 543 | %511 = fmul float %96, %96 |
| 544 | %512 = fadd float %511, %510 |
| 545 | %513 = fmul float %97, %97 |
| 546 | %514 = fadd float %512, %513 |
| 547 | %515 = call float @llvm.AMDGPU.rsq(float %514) |
| 548 | %516 = fmul float %95, %515 |
| 549 | %517 = fmul float %96, %515 |
| 550 | %518 = fmul float %97, %515 |
| 551 | %519 = fmul float %505, %516 |
| 552 | %520 = fmul float %507, %517 |
| 553 | %521 = fadd float %520, %519 |
| 554 | %522 = fmul float %509, %518 |
| 555 | %523 = fadd float %521, %522 |
| 556 | %524 = fsub float -0.000000e+00, %523 |
| 557 | %525 = fcmp uge float %524, 0.000000e+00 |
| 558 | %526 = select i1 %525, float %524, float 0.000000e+00 |
| 559 | %527 = fmul float %43, %380 |
| 560 | %528 = fadd float %527, 1.000000e+00 |
| 561 | %529 = call float @llvm.pow.f32(float %526, float %528) |
| 562 | %530 = fmul float %476, %37 |
| 563 | %531 = fmul float %478, %38 |
| 564 | %532 = fmul float %480, %39 |
| 565 | %533 = fmul float %359, %487 |
| 566 | %534 = fmul float %360, %488 |
| 567 | %535 = fadd float %534, %533 |
| 568 | %536 = fmul float %361, %489 |
| 569 | %537 = fadd float %535, %536 |
| 570 | %538 = fcmp uge float %537, 0.000000e+00 |
| 571 | %539 = select i1 %538, float %537, float 0.000000e+00 |
| 572 | %540 = fmul float %530, %539 |
| 573 | %541 = fmul float %531, %539 |
| 574 | %542 = fmul float %532, %539 |
| 575 | %543 = fmul float %490, %529 |
| 576 | %544 = fadd float %543, %540 |
| 577 | %545 = fmul float %491, %529 |
| 578 | %546 = fadd float %545, %541 |
| 579 | %547 = fmul float %492, %529 |
| 580 | %548 = fadd float %547, %542 |
| 581 | %549 = fmul float %476, %34 |
| 582 | %550 = fmul float %478, %35 |
| 583 | %551 = fmul float %480, %36 |
| 584 | %552 = fmul float %544, %57 |
| 585 | %553 = fadd float %552, %549 |
| 586 | %554 = fmul float %546, %58 |
| 587 | %555 = fadd float %554, %550 |
| 588 | %556 = fmul float %548, %59 |
| 589 | %557 = fadd float %556, %551 |
| 590 | %558 = bitcast float %136 to i32 |
| 591 | %559 = bitcast float %182 to i32 |
| 592 | %560 = bitcast float %137 to i32 |
| 593 | %561 = bitcast float %183 to i32 |
| 594 | %562 = bitcast float %temp28.1 to i32 |
| 595 | %563 = bitcast float %temp29.1 to i32 |
| 596 | %564 = insertelement <8 x i32> undef, i32 %558, i32 0 |
| 597 | %565 = insertelement <8 x i32> %564, i32 %559, i32 1 |
| 598 | %566 = insertelement <8 x i32> %565, i32 %560, i32 2 |
| 599 | %567 = insertelement <8 x i32> %566, i32 %561, i32 3 |
| 600 | %568 = insertelement <8 x i32> %567, i32 %562, i32 4 |
| 601 | %569 = insertelement <8 x i32> %568, i32 %563, i32 5 |
| 602 | %570 = insertelement <8 x i32> %569, i32 undef, i32 6 |
| 603 | %571 = insertelement <8 x i32> %570, i32 undef, i32 7 |
| 604 | %572 = call <4 x float> @llvm.SI.sampled.v8i32(<8 x i32> %571, <32 x i8> %74, <16 x i8> %76, i32 2) |
| 605 | %573 = extractelement <4 x float> %572, i32 0 |
| 606 | %574 = extractelement <4 x float> %572, i32 1 |
| 607 | %575 = extractelement <4 x float> %572, i32 2 |
| 608 | %576 = fmul float %573, %44 |
| 609 | %577 = fadd float %576, %553 |
| 610 | %578 = fmul float %574, %45 |
| 611 | %579 = fadd float %578, %555 |
| 612 | %580 = fmul float %575, %46 |
| 613 | %581 = fadd float %580, %557 |
| 614 | %582 = call i32 @llvm.SI.packf16(float %577, float %579) |
| 615 | %583 = bitcast i32 %582 to float |
| 616 | %584 = call i32 @llvm.SI.packf16(float %581, float %283) |
| 617 | %585 = bitcast i32 %584 to float |
| 618 | call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 1, float %583, float %585, float %583, float %585) |
| 619 | ret void |
| 620 | |
| 621 | ENDIF66: ; preds = %LOOP65 |
| 622 | %586 = bitcast float %temp28.1 to i32 |
| 623 | %587 = bitcast float %temp29.1 to i32 |
| 624 | %588 = insertelement <8 x i32> %237, i32 %586, i32 4 |
| 625 | %589 = insertelement <8 x i32> %588, i32 %587, i32 5 |
| 626 | %590 = insertelement <8 x i32> %589, i32 undef, i32 6 |
| 627 | %591 = insertelement <8 x i32> %590, i32 undef, i32 7 |
| 628 | %592 = call <4 x float> @llvm.SI.sampled.v8i32(<8 x i32> %591, <32 x i8> %62, <16 x i8> %64, i32 2) |
| 629 | %593 = extractelement <4 x float> %592, i32 3 |
| 630 | %594 = fcmp oge float %temp30.1, %593 |
| 631 | %595 = sext i1 %594 to i32 |
| 632 | %596 = bitcast i32 %595 to float |
| 633 | %597 = bitcast float %596 to i32 |
| 634 | %598 = and i32 %597, 1065353216 |
| 635 | %599 = bitcast i32 %598 to float |
| 636 | %600 = fmul float 5.000000e-01, %temp32.0 |
| 637 | %601 = fsub float -0.000000e+00, %600 |
| 638 | %602 = fmul float %599, %temp32.0 |
| 639 | %603 = fadd float %602, %601 |
| 640 | %604 = fmul float %214, %603 |
| 641 | %605 = fadd float %604, %temp28.1 |
| 642 | %606 = fmul float %215, %603 |
| 643 | %607 = fadd float %606, %temp29.1 |
| 644 | %608 = fmul float %216, %603 |
| 645 | %609 = fadd float %608, %temp30.1 |
| 646 | %610 = fadd float %temp24.1, 1.000000e+00 |
| 647 | %611 = fmul float %temp32.0, 5.000000e-01 |
| 648 | br label %LOOP65 |
| 649 | } |
| 650 | |
| 651 | ; Function Attrs: nounwind readnone |
| 652 | declare float @llvm.SI.load.const(<16 x i8>, i32) #1 |
| 653 | |
| 654 | ; Function Attrs: nounwind readnone |
| 655 | declare float @llvm.SI.fs.interp(i32, i32, i32, <2 x i32>) #1 |
| 656 | |
| 657 | ; Function Attrs: readnone |
| 658 | declare i32 @llvm.SI.tid() #2 |
| 659 | |
| 660 | ; Function Attrs: readonly |
| 661 | declare float @ceil(float) #3 |
| 662 | |
| 663 | ; Function Attrs: readnone |
| 664 | declare float @llvm.AMDGPU.rsq(float) #2 |
| 665 | |
| 666 | ; Function Attrs: nounwind readnone |
| 667 | declare <4 x float> @llvm.SI.sampled.v8i32(<8 x i32>, <32 x i8>, <16 x i8>, i32) #1 |
| 668 | |
| 669 | ; Function Attrs: readnone |
| 670 | declare <4 x float> @llvm.AMDGPU.cube(<4 x float>) #2 |
| 671 | |
| 672 | ; Function Attrs: readnone |
| 673 | declare float @fabs(float) #2 |
| 674 | |
| 675 | ; Function Attrs: nounwind readnone |
| 676 | declare <4 x float> @llvm.SI.sample.v4i32(<4 x i32>, <32 x i8>, <16 x i8>, i32) #1 |
| 677 | |
| 678 | ; Function Attrs: nounwind readonly |
| 679 | declare float @llvm.pow.f32(float, float) #4 |
| 680 | |
| 681 | ; Function Attrs: nounwind readnone |
| 682 | declare i32 @llvm.SI.packf16(float, float) #1 |
| 683 | |
| 684 | declare void @llvm.SI.export(i32, i32, i32, i32, i32, float, float, float, float) |
| 685 | |
| 686 | attributes #0 = { "ShaderType"="0" } |
| 687 | attributes #1 = { nounwind readnone } |
| 688 | attributes #2 = { readnone } |
| 689 | attributes #3 = { readonly } |
| 690 | attributes #4 = { nounwind readonly } |
| 691 | |
| 692 | !0 = metadata !{metadata !"const", null, i32 1} |