Skip to content

Commit

Permalink
Sanitized statement splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
kumasento committed May 24, 2021
1 parent 5b36310 commit e434869
Show file tree
Hide file tree
Showing 177 changed files with 14,529 additions and 88,513 deletions.
578 changes: 578 additions & 0 deletions example/polybench/split-and-merge/2mm/2mm.heuristic.polymer.par.log

Large diffs are not rendered by default.

117 changes: 80 additions & 37 deletions example/polybench/split-and-merge/2mm/2mm.heuristic.polymer.par.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
#map7 = affine_map<(d0, d1) -> (2200, d0 * 32 - d1 * 32 + 32)>
#map8 = affine_map<(d0) -> (0, (d0 * 32 - 1799) ceildiv 32)>
#map9 = affine_map<(d0, d1) -> (1800, d0 * 32 - d1 * 32 + 32)>
#map10 = affine_map<()[s0] -> ((s0 - 1) floordiv 32 + 1)>
#map11 = affine_map<(d0)[s0] -> (s0, d0 * 32 + 32)>
#map12 = affine_map<()[s0, s1] -> ((s0 + s1 - 2) floordiv 32 + 1)>
#map13 = affine_map<(d0)[s0] -> (0, (d0 * 32 - s0 + 1) ceildiv 32)>
#map14 = affine_map<(d0)[s0] -> ((s0 - 1) floordiv 32 + 1, d0 + 1)>
#map15 = affine_map<(d0, d1)[s0] -> (s0, d0 * 32 - d1 * 32 + 32)>
#set0 = affine_set<()[s0] : (s0 - 1 >= 0)>
#set1 = affine_set<()[s0, s1] : (s0 - 1 >= 0, s1 - 1 >= 0)>
module attributes {llvm.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128", llvm.target_triple = "x86_64-unknown-linux-gnu"} {
llvm.mlir.global internal constant @str7("==END DUMP_ARRAYS==\0A\00")
llvm.mlir.global internal constant @str6("\0Aend dump: %s\0A\00")
Expand Down Expand Up @@ -234,44 +242,79 @@ module attributes {llvm.data_layout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i6
func private @polybench_timer_start()
func private @polybench_timer_stop()
func private @polybench_timer_print()
func private @S0(%arg0: memref<?x1800xf64>, %arg1: index, %arg2: index) attributes {scop.stmt} {
func @kernel_2mm(%arg0: i32, %arg1: i32, %arg2: i32, %arg3: i32, %arg4: f64, %arg5: f64, %arg6: memref<?x1800xf64>, %arg7: memref<?x2200xf64>, %arg8: memref<?x1800xf64>, %arg9: memref<?x2400xf64>, %arg10: memref<?x2400xf64>, %arg11: memref<?xf64>, %arg12: memref<?xf64>) {
%cst = constant 0.000000e+00 : f64
affine.store %cst, %arg0[symbol(%arg1), symbol(%arg2)] : memref<?x1800xf64>
return
}
func private @S1(%arg0: memref<?xf64>, %arg1: index, %arg2: memref<?x1800xf64>, %arg3: index, %arg4: f64, %arg5: memref<?x2200xf64>, %arg6: index) attributes {scop.stmt} {
%0 = affine.load %arg5[symbol(%arg6), symbol(%arg1)] : memref<?x2200xf64>
%1 = mulf %arg4, %0 : f64
%2 = affine.load %arg2[symbol(%arg1), symbol(%arg3)] : memref<?x1800xf64>
%3 = mulf %1, %2 {scop.splittable = 0 : index} : f64
affine.store %3, %arg0[symbol(%arg1)] : memref<?xf64>
return
}
func private @S2(%arg0: memref<?x1800xf64>, %arg1: index, %arg2: index, %arg3: memref<?xf64>, %arg4: index) attributes {scop.stmt} {
%0 = affine.load %arg0[symbol(%arg1), symbol(%arg2)] : memref<?x1800xf64>
%1 = affine.load %arg3[symbol(%arg4)] : memref<?xf64>
%2 = addf %0, %1 : f64
affine.store %2, %arg0[symbol(%arg1), symbol(%arg2)] : memref<?x1800xf64>
return
}
func private @S3(%arg0: memref<?x2400xf64>, %arg1: index, %arg2: index, %arg3: f64) attributes {scop.stmt} {
%0 = affine.load %arg0[symbol(%arg1), symbol(%arg2)] : memref<?x2400xf64>
%1 = mulf %0, %arg3 : f64
affine.store %1, %arg0[symbol(%arg1), symbol(%arg2)] : memref<?x2400xf64>
return
}
func private @S4(%arg0: memref<?xf64>, %arg1: index, %arg2: memref<?x2400xf64>, %arg3: index, %arg4: memref<?x1800xf64>, %arg5: index) attributes {scop.stmt} {
%0 = affine.load %arg4[symbol(%arg5), symbol(%arg1)] : memref<?x1800xf64>
%1 = affine.load %arg2[symbol(%arg1), symbol(%arg3)] : memref<?x2400xf64>
%2 = mulf %0, %1 {scop.splittable = 1 : index} : f64
affine.store %2, %arg0[symbol(%arg1)] : memref<?xf64>
return
}
func private @S5(%arg0: memref<?x2400xf64>, %arg1: index, %arg2: index, %arg3: memref<?xf64>, %arg4: index) attributes {scop.stmt} {
%0 = affine.load %arg0[symbol(%arg1), symbol(%arg2)] : memref<?x2400xf64>
%1 = affine.load %arg3[symbol(%arg4)] : memref<?xf64>
%2 = addf %0, %1 : f64
affine.store %2, %arg0[symbol(%arg1), symbol(%arg2)] : memref<?x2400xf64>
%0 = index_cast %arg0 : i32 to index
%1 = index_cast %arg1 : i32 to index
%2 = index_cast %arg2 : i32 to index
%3 = index_cast %arg3 : i32 to index
affine.if #set0()[%0] {
affine.if #set0()[%3] {
affine.for %arg13 = 0 to #map10()[%0] {
affine.for %arg14 = 0 to #map10()[%3] {
affine.for %arg15 = #map0(%arg13) to min #map11(%arg13)[%0] {
affine.for %arg16 = #map0(%arg14) to min #map11(%arg14)[%3] {
%4 = affine.load %arg10[%arg15, %arg16] : memref<?x2400xf64>
%5 = mulf %4, %arg5 : f64
affine.store %5, %arg10[%arg15, %arg16] : memref<?x2400xf64>
}
}
}
} {scop.parallelizable}
}
affine.if #set0()[%1] {
affine.for %arg13 = 0 to #map10()[%0] {
affine.for %arg14 = 0 to #map10()[%1] {
affine.for %arg15 = #map0(%arg13) to min #map11(%arg13)[%0] {
affine.for %arg16 = #map0(%arg14) to min #map11(%arg14)[%1] {
affine.store %cst, %arg6[%arg15, %arg16] : memref<?x1800xf64>
}
}
}
} {scop.parallelizable}
}
affine.if #set1()[%1, %2] {
affine.for %arg13 = 0 to #map12()[%0, %2] {
affine.for %arg14 = max #map13(%arg13)[%2] to min #map14(%arg13)[%0] {
affine.for %arg15 = #map6(%arg13, %arg14) to min #map15(%arg13, %arg14)[%2] {
affine.for %arg16 = #map0(%arg14) to min #map11(%arg14)[%0] {
affine.for %arg17 = 0 to %1 {
%4 = affine.load %arg7[%arg16, %arg15] : memref<?x2200xf64>
%5 = mulf %arg4, %4 : f64
%6 = affine.load %arg8[%arg15, %arg17] : memref<?x1800xf64>
%7 = mulf %5, %6 {scop.splittable = 0 : index} : f64
affine.store %7, %arg11[%arg15] : memref<?xf64>
%8 = affine.load %arg6[%arg16, %arg17] : memref<?x1800xf64>
%9 = affine.load %arg11[%arg15] : memref<?xf64>
%10 = addf %8, %9 : f64
affine.store %10, %arg6[%arg16, %arg17] : memref<?x1800xf64>
}
}
}
} {scop.parallelizable}
}
}
affine.if #set1()[%1, %3] {
affine.for %arg13 = 0 to #map12()[%0, %1] {
affine.for %arg14 = max #map13(%arg13)[%1] to min #map14(%arg13)[%0] {
affine.for %arg15 = #map6(%arg13, %arg14) to min #map15(%arg13, %arg14)[%1] {
affine.for %arg16 = #map0(%arg14) to min #map11(%arg14)[%0] {
affine.for %arg17 = 0 to %3 {
%4 = affine.load %arg6[%arg16, %arg15] : memref<?x1800xf64>
%5 = affine.load %arg9[%arg15, %arg17] : memref<?x2400xf64>
%6 = mulf %4, %5 {scop.splittable = 1 : index} : f64
affine.store %6, %arg11[%arg15] : memref<?xf64>
%7 = affine.load %arg10[%arg16, %arg17] : memref<?x2400xf64>
%8 = affine.load %arg11[%arg15] : memref<?xf64>
%9 = addf %7, %8 : f64
affine.store %9, %arg10[%arg16, %arg17] : memref<?x2400xf64>
}
}
}
} {scop.parallelizable}
}
}
}
return
}
func private @print_array(%arg0: i32, %arg1: i32, %arg2: memref<?x2400xf64>) {
Expand Down
Loading

0 comments on commit e434869

Please sign in to comment.