73 lines · plain
1// RUN: mlir-opt %s -enable-arm-streaming -verify-diagnostics | FileCheck %s2// RUN: mlir-opt %s -enable-arm-streaming=streaming-mode=streaming-locally -verify-diagnostics | FileCheck %s -check-prefix=CHECK-LOCALLY3// RUN: mlir-opt %s -enable-arm-streaming=streaming-mode=streaming-compatible -verify-diagnostics | FileCheck %s -check-prefix=CHECK-COMPATIBLE4// RUN: mlir-opt %s -enable-arm-streaming=za-mode=new-za -verify-diagnostics | FileCheck %s -check-prefix=CHECK-ENABLE-ZA5// RUN: mlir-opt %s -enable-arm-streaming=if-required-by-ops -verify-diagnostics | FileCheck %s -check-prefix=IF-REQUIRED6// RUN: mlir-opt %s -enable-arm-streaming=if-scalable-and-supported -verify-diagnostics | FileCheck %s -check-prefix=IF-SCALABLE7 8// CHECK-LABEL: @arm_streaming9// CHECK-SAME: attributes {arm_streaming}10// CHECK-LOCALLY-LABEL: @arm_streaming11// CHECK-LOCALLY-SAME: attributes {arm_locally_streaming}12// CHECK-COMPATIBLE-LABEL: @arm_streaming13// CHECK-COMPATIBLE-SAME: attributes {arm_streaming_compatible}14// CHECK-ENABLE-ZA-LABEL: @arm_streaming15// CHECK-ENABLE-ZA-SAME: attributes {arm_new_za, arm_streaming}16func.func @arm_streaming() { return }17 18// CHECK-LABEL: @not_arm_streaming19// CHECK-SAME: attributes {enable_arm_streaming_ignore}20// CHECK-LOCALLY-LABEL: @not_arm_streaming21// CHECK-LOCALLY-SAME: attributes {enable_arm_streaming_ignore}22// CHECK-COMPATIBLE-LABEL: @not_arm_streaming23// CHECK-COMPATIBLE-SAME: attributes {enable_arm_streaming_ignore}24// CHECK-ENABLE-ZA-LABEL: @not_arm_streaming25// CHECK-ENABLE-ZA-SAME: attributes {enable_arm_streaming_ignore}26func.func @not_arm_streaming() attributes {enable_arm_streaming_ignore} { return }27 28// CHECK-LABEL: @requires_arm_streaming29// CHECK-SAME: attributes {arm_streaming}30// IF-REQUIRED: @requires_arm_streaming31// IF-REQUIRED-SAME: attributes {arm_streaming}32func.func @requires_arm_streaming() {33 %tile = arm_sme.get_tile : vector<[4]x[4]xi32>34 return35}36 37// CHECK-LABEL: @does_not_require_arm_streaming38// CHECK-SAME: attributes {arm_streaming}39// IF-REQUIRED: @does_not_require_arm_streaming40// IF-REQUIRED-NOT: arm_streaming41func.func @does_not_require_arm_streaming() { return }42 43// IF-SCALABLE-LABEL: @contains_scalable_vectors44// IF-SCALABLE-SAME: attributes {arm_streaming}45func.func @contains_scalable_vectors(%vec: vector<[4]xf32>) -> vector<[4]xf32> {46 %0 = arith.addf %vec, %vec : vector<[4]xf32>47 return %0 : vector<[4]xf32>48}49 50// IF-SCALABLE-LABEL: @no_scalable_vectors51// IF-SCALABLE-NOT: arm_streaming52func.func @no_scalable_vectors(%vec: vector<4xf32>) -> vector<4xf32> {53 %0 = arith.addf %vec, %vec : vector<4xf32>54 return %0 : vector<4xf32>55}56 57// IF-SCALABLE-LABEL: @contains_gather58// IF-SCALABLE-NOT: arm_streaming59func.func @contains_gather(%base: memref<?xf32>, %v: vector<[4]xindex>, %mask: vector<[4]xi1>, %pass_thru: vector<[4]xf32>) -> vector<[4]xf32> {60 %c0 = arith.constant 0 : index61 %0 = vector.gather %base[%c0][%v], %mask, %pass_thru : memref<?xf32>, vector<[4]xindex>, vector<[4]xi1>, vector<[4]xf32> into vector<[4]xf32>62 return %0 : vector<[4]xf32>63}64 65// IF-SCALABLE-LABEL: @contains_scatter66// IF-SCALABLE-NOT: arm_streaming67func.func @contains_scatter(%base: memref<?xf32>, %v: vector<[4]xindex>,%mask: vector<[4]xi1>, %value: vector<[4]xf32>)68{69 %c0 = arith.constant 0 : index70 vector.scatter %base[%c0][%v], %mask, %value : memref<?xf32>, vector<[4]xindex>, vector<[4]xi1>, vector<[4]xf32>71 return72}73