brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 6099eea Raw
47 lines · plain
1// RUN: mlir-opt %s -transform-interpreter -test-transform-dialect-erase-schedule -lower-vector-mask -one-shot-bufferize -buffer-deallocation-pipeline -test-lower-to-llvm | \2// RUN: %mcr_aarch64_cmd -e=entry -entry-point-result=void --march=aarch64 --mattr="+sve" -shared-libs=%native_mlir_runner_utils,%native_mlir_c_runner_utils | \3// RUN: FileCheck %s4 5func.func @entry() {6  %c4 = arith.constant 4 : index7  %c0 = arith.constant 0 : index8  %step = arith.constant 1 : index9  %c1_f32 = arith.constant 123.0 : f3210 11  %vscale = vector.vscale12  %vl_fp = arith.muli %c4, %vscale : index13  %vec = bufferization.alloc_tensor(%vl_fp) : tensor<?xf32>14 15  %vec_out = scf.for %i = %c0 to %vl_fp step %step iter_args(%vin = %vec) -> tensor<?xf32> {16    %vout = tensor.insert %c1_f32 into %vin[%i] : tensor<?xf32>17    scf.yield %vout : tensor<?xf32>18  }19 20  %pi = arith.constant  3.14 : f3221  %vec_out_1 = linalg.fill ins(%pi : f32) outs(%vec_out : tensor<?xf32>) -> tensor<?xf32>22 23  // There are at least 4 f32 elements in every SVE vector. For implementations24  // with wider vectors, you should see more elements being printed.25  // CHECK: 3.1426  // CHECK: 3.1427  // CHECK: 3.1428  // CHECK: 3.1429  scf.for %i = %c0 to %vl_fp step %step {30    %element = tensor.extract %vec_out_1[%i] : tensor<?xf32>31    vector.print %element : f3232  }33 34  // CHECK: SVE: END OF TEST OUTPUT35  vector.print str "SVE: END OF TEST OUTPUT"36 37  return38}39 40module attributes {transform.with_named_sequence} {41  transform.named_sequence @__transform_main(%arg1: !transform.any_op {transform.readonly}) {42    %0 = transform.structured.match ops{["linalg.fill"]} in %arg1 : (!transform.any_op) -> !transform.any_op43    transform.structured.vectorize %0 vector_sizes [[4]] : !transform.any_op44    transform.yield45  }46}47