brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · dc4e042 Raw
44 lines · plain
1// RUN: mlir-opt -allow-unregistered-dialect %s -pass-pipeline='builtin.module(func.func(test-scf-parallel-loop-collapsing{collapsed-indices-0=0,3 collapsed-indices-1=1,4 collapsed-indices-2=2}, canonicalize))' --mlir-print-local-scope | FileCheck %s2 3// CHECK: func @parallel_many_dims() {4func.func @parallel_many_dims() {5  %c0 = arith.constant 0 : index6  %c1 = arith.constant 1 : index7  %c2 = arith.constant 2 : index8  %c3 = arith.constant 3 : index9  %c4 = arith.constant 4 : index10  %c5 = arith.constant 5 : index11  %c6 = arith.constant 6 : index12  %c7 = arith.constant 7 : index13  %c8 = arith.constant 8 : index14  %c9 = arith.constant 9 : index15  %c10 = arith.constant 10 : index16  %c11 = arith.constant 11 : index17  %c12 = arith.constant 12 : index18  %c13 = arith.constant 13 : index19  %c14 = arith.constant 14 : index20  %c15 = arith.constant 15 : index21  %c26 = arith.constant 26 : index22 23  scf.parallel (%i0, %i1, %i2, %i3, %i4) = (%c0, %c3, %c6, %c9, %c12)24    to (%c2, %c5, %c8, %c26, %c14) step (%c1, %c4, %c7, %c10, %c13) {25    %result = "magic.op"(%i0, %i1, %i2, %i3, %i4)26        : (index, index, index, index, index) -> index27  }28  return29}30 31// CHECK-DAG: %[[C3:.*]] = arith.constant 3 : index32// CHECK-DAG: %[[C6:.*]] = arith.constant 6 : index33// CHECK-DAG: %[[C12:.*]] = arith.constant 12 : index34// CHECK-DAG: %[[C0:.*]] = arith.constant 0 : index35// CHECK-DAG: %[[C1:.*]] = arith.constant 1 : index36// CHECK-DAG: %[[C2:.*]] = arith.constant 2 : index37// CHECK-DAG: %[[C4:.*]] = arith.constant 4 : index38// CHECK: scf.parallel (%[[NEW_I0:.*]]) = (%[[C0]]) to (%[[C4]]) step (%[[C1]]) {39// CHECK:   %[[V0:.*]] = arith.remsi %[[NEW_I0]], %[[C2]] : index40// CHECK:   %[[I0:.*]] = arith.divsi %[[NEW_I0]], %[[C2]] : index41// CHECK:   %[[I3:.*]] = affine.apply affine_map<(d0) -> (d0 * 10 + 9)>(%[[V0]])42// CHECK:   "magic.op"(%[[I0]], %[[C3]], %[[C6]], %[[I3]], %[[C12]]) : (index, index, index, index, index) -> index43// CHECK:   scf.reduce44