183 lines
7.0 KiB
LLVM
183 lines
7.0 KiB
LLVM
@M = dso_local global i32 0
|
|
@L = dso_local global i32 0
|
|
@N = dso_local global i32 0
|
|
declare i32 @getint()
|
|
declare i32 @getch()
|
|
declare float @getfloat()
|
|
declare void @putint(i32 %p0)
|
|
declare void @putch(i32 %p0)
|
|
declare void @putfloat(float %p0)
|
|
declare i32 @getarray(i32* %p0)
|
|
declare i32 @getfarray(float* %p0)
|
|
declare void @putarray(i32 %p0, i32* %p1)
|
|
declare void @putfarray(i32 %p0, float* %p1)
|
|
declare void @_sysy_starttime(i32 %p0)
|
|
declare void @_sysy_stoptime(i32 %p0)
|
|
declare i32 @thrd_create(i32 %p0)
|
|
declare void @thrd_join()
|
|
declare void @putf()
|
|
declare void @llvm.memset.p0.i32(i32* %p0, i8 %p1, i32 %p2, i1 %p3)
|
|
define i32 @main() {
|
|
entry:
|
|
store i32 3, ptr @N
|
|
store i32 3, ptr @M
|
|
store i32 3, ptr @L
|
|
%alloca_89 = alloca [3 x float]
|
|
%alloca_90 = alloca [3 x float]
|
|
%alloca_91 = alloca [3 x float]
|
|
%alloca_92 = alloca [3 x float]
|
|
%alloca_93 = alloca [3 x float]
|
|
%alloca_94 = alloca [3 x float]
|
|
%alloca_95 = alloca [6 x float]
|
|
%alloca_96 = alloca [3 x float]
|
|
%alloca_97 = alloca [3 x float]
|
|
%getelementptr_303 = getelementptr [3 x float], ptr %alloca_94, i32 0
|
|
%getelementptr_304 = getelementptr [3 x float], ptr %alloca_90, i32 0
|
|
%getelementptr_305 = getelementptr [3 x float], ptr %alloca_91, i32 0
|
|
%getelementptr_306 = getelementptr [3 x float], ptr %alloca_89, i32 0
|
|
%getelementptr_307 = getelementptr [3 x float], ptr %alloca_92, i32 0
|
|
%getelementptr_308 = getelementptr [3 x float], ptr %alloca_93, i32 0
|
|
%call_309 = call i32 @thrd_create(i32 4)
|
|
%Mul_311 = mul i32 %call_309, 3
|
|
%SDiv_312 = sdiv i32 %Mul_311, 5
|
|
%Add_314 = add i32 %Mul_311, 3
|
|
%SDiv_315 = sdiv i32 %Add_314, 5
|
|
br label %cond0
|
|
|
|
cond0:
|
|
%phi_224 = phi i32 [%SDiv_312, %entry], [%Add_135, %body1]
|
|
%icmp_317 = icmp slt i32 %phi_224, %SDiv_315
|
|
br i1 %icmp_317, label %body1, label %final2_split2
|
|
|
|
body1:
|
|
%getelementptr_105 = getelementptr [3 x float], ptr %getelementptr_306, i32 0, i32 %phi_224
|
|
%itofp_107 = sitofp i32 %phi_224 to float
|
|
store float %itofp_107, ptr %getelementptr_105
|
|
%getelementptr_110 = getelementptr [3 x float], ptr %getelementptr_304, i32 0, i32 %phi_224
|
|
store float %itofp_107, ptr %getelementptr_110
|
|
%getelementptr_115 = getelementptr [3 x float], ptr %getelementptr_305, i32 0, i32 %phi_224
|
|
store float %itofp_107, ptr %getelementptr_115
|
|
%getelementptr_120 = getelementptr [3 x float], ptr %getelementptr_307, i32 0, i32 %phi_224
|
|
store float %itofp_107, ptr %getelementptr_120
|
|
%getelementptr_125 = getelementptr [3 x float], ptr %getelementptr_308, i32 0, i32 %phi_224
|
|
store float %itofp_107, ptr %getelementptr_125
|
|
%getelementptr_130 = getelementptr [3 x float], ptr %getelementptr_303, i32 0, i32 %phi_224
|
|
store float %itofp_107, ptr %getelementptr_130
|
|
%Add_135 = add i32 %phi_224, 1
|
|
br label %cond0
|
|
|
|
final2_split2:
|
|
call void @thrd_join()
|
|
%getelementptr_285 = getelementptr [3 x float], ptr %alloca_91, i32 0, i32 1
|
|
%getelementptr_286 = getelementptr [3 x float], ptr %alloca_96, i32 0, i32 2
|
|
%load_245 = load float, ptr %getelementptr_285
|
|
store float %load_245, ptr %getelementptr_286
|
|
%getelementptr_287 = getelementptr [3 x float], ptr %alloca_90, i32 0, i32 2
|
|
%getelementptr_288 = getelementptr [3 x float], ptr %alloca_97, i32 0, i32 1
|
|
%load_249 = load float, ptr %getelementptr_287
|
|
store float %load_249, ptr %getelementptr_288
|
|
%getelementptr_289 = getelementptr [3 x float], ptr %alloca_90, i32 0, i32 0
|
|
%getelementptr_290 = getelementptr [6 x float], ptr %alloca_95, i32 0, i32 1
|
|
%load_253 = load float, ptr %getelementptr_289
|
|
store float %load_253, ptr %getelementptr_290
|
|
%getelementptr_291 = getelementptr [3 x float], ptr %alloca_91, i32 0, i32 0
|
|
%getelementptr_292 = getelementptr [6 x float], ptr %alloca_95, i32 0, i32 2
|
|
%load_257 = load float, ptr %getelementptr_291
|
|
store float %load_257, ptr %getelementptr_292
|
|
%getelementptr_293 = getelementptr [3 x float], ptr %alloca_89, i32 0, i32 1
|
|
%getelementptr_294 = getelementptr [3 x float], ptr %alloca_96, i32 0, i32 0
|
|
%load_261 = load float, ptr %getelementptr_293
|
|
store float %load_261, ptr %getelementptr_294
|
|
%getelementptr_295 = getelementptr [3 x float], ptr %alloca_89, i32 0, i32 2
|
|
%getelementptr_296 = getelementptr [3 x float], ptr %alloca_97, i32 0, i32 0
|
|
%load_265 = load float, ptr %getelementptr_295
|
|
store float %load_265, ptr %getelementptr_296
|
|
%getelementptr_297 = getelementptr [3 x float], ptr %alloca_90, i32 0, i32 1
|
|
%getelementptr_298 = getelementptr [3 x float], ptr %alloca_96, i32 0, i32 1
|
|
%load_269 = load float, ptr %getelementptr_297
|
|
store float %load_269, ptr %getelementptr_298
|
|
%getelementptr_299 = getelementptr [3 x float], ptr %alloca_91, i32 0, i32 2
|
|
%getelementptr_300 = getelementptr [3 x float], ptr %alloca_97, i32 0, i32 2
|
|
%load_273 = load float, ptr %getelementptr_299
|
|
store float %load_273, ptr %getelementptr_300
|
|
%getelementptr_301 = getelementptr [3 x float], ptr %alloca_89, i32 0, i32 0
|
|
%getelementptr_302 = getelementptr [6 x float], ptr %alloca_95, i32 0, i32 0
|
|
%load_277 = load float, ptr %getelementptr_301
|
|
store float %load_277, ptr %getelementptr_302
|
|
%getelementptr_319 = getelementptr [6 x float], ptr %alloca_95, i32 0
|
|
%call_320 = call i32 @thrd_create(i32 4)
|
|
%Mul_322 = mul i32 %call_320, 3
|
|
%SDiv_323 = sdiv i32 %Mul_322, 5
|
|
%Add_325 = add i32 %Mul_322, 3
|
|
%SDiv_326 = sdiv i32 %Add_325, 5
|
|
br label %cond3
|
|
|
|
cond3:
|
|
%phi_225 = phi i32 [%SDiv_323, %final2_split2], [%Add_166, %body4]
|
|
%icmp_328 = icmp slt i32 %phi_225, %SDiv_326
|
|
br i1 %icmp_328, label %body4, label %final5
|
|
|
|
body4:
|
|
%getelementptr_159 = getelementptr [6 x float], ptr %getelementptr_319, i32 0, i32 %phi_225
|
|
%load_160 = load float, ptr %getelementptr_159
|
|
%fptoi_161 = fptosi float %load_160 to i32
|
|
call void @putint(i32 %fptoi_161)
|
|
%Add_166 = add i32 %phi_225, 1
|
|
br label %cond3
|
|
|
|
final5:
|
|
call void @thrd_join()
|
|
call void @putch(i32 10)
|
|
%getelementptr_330 = getelementptr [3 x float], ptr %alloca_96, i32 0
|
|
%call_331 = call i32 @thrd_create(i32 4)
|
|
%Mul_333 = mul i32 %call_331, 3
|
|
%SDiv_334 = sdiv i32 %Mul_333, 5
|
|
%Add_336 = add i32 %Mul_333, 3
|
|
%SDiv_337 = sdiv i32 %Add_336, 5
|
|
br label %cond6
|
|
|
|
cond6:
|
|
%phi_226 = phi i32 [%SDiv_334, %final5], [%Add_189, %body7]
|
|
%icmp_339 = icmp slt i32 %phi_226, %SDiv_337
|
|
br i1 %icmp_339, label %body7, label %final8
|
|
|
|
body7:
|
|
%getelementptr_182 = getelementptr [3 x float], ptr %getelementptr_330, i32 0, i32 %phi_226
|
|
%load_183 = load float, ptr %getelementptr_182
|
|
%fptoi_184 = fptosi float %load_183 to i32
|
|
call void @putint(i32 %fptoi_184)
|
|
%Add_189 = add i32 %phi_226, 1
|
|
br label %cond6
|
|
|
|
final8:
|
|
call void @thrd_join()
|
|
call void @putch(i32 10)
|
|
%getelementptr_341 = getelementptr [3 x float], ptr %alloca_97, i32 0
|
|
%call_342 = call i32 @thrd_create(i32 4)
|
|
%Mul_344 = mul i32 %call_342, 3
|
|
%SDiv_345 = sdiv i32 %Mul_344, 5
|
|
%Add_347 = add i32 %Mul_344, 3
|
|
%SDiv_348 = sdiv i32 %Add_347, 5
|
|
br label %cond9
|
|
|
|
cond9:
|
|
%phi_227 = phi i32 [%SDiv_345, %final8], [%Add_212, %body10]
|
|
%icmp_350 = icmp slt i32 %phi_227, %SDiv_348
|
|
br i1 %icmp_350, label %body10, label %exit
|
|
|
|
body10:
|
|
%getelementptr_205 = getelementptr [3 x float], ptr %getelementptr_341, i32 0, i32 %phi_227
|
|
%load_206 = load float, ptr %getelementptr_205
|
|
%fptoi_207 = fptosi float %load_206 to i32
|
|
call void @putint(i32 %fptoi_207)
|
|
%Add_212 = add i32 %phi_227, 1
|
|
br label %cond9
|
|
|
|
exit:
|
|
call void @thrd_join()
|
|
call void @putch(i32 10)
|
|
ret i32 0
|
|
|
|
|
|
}
|