Skip to content

Commit 06f22c9

Browse files
authored
[mlir][ArmSME] Add enable_arm_streaming_ignore attribute (#66911)
This attribute makes the `enable_arm_streaming` pass ignore a function (i.e. not add the enable streaming/za attributes). The main use case for this is to prevent helper functions within tests being made streaming functions.
1 parent a44b787 commit 06f22c9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

mlir/lib/Dialect/ArmSME/Transforms/EnableArmStreaming.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ using namespace mlir::arm_sme;
5252
static constexpr char kArmStreamingAttr[] = "arm_streaming";
5353
static constexpr char kArmLocallyStreamingAttr[] = "arm_locally_streaming";
5454
static constexpr char kArmZAAttr[] = "arm_za";
55+
static constexpr char kEnableArmStreamingIgnoreAttr[] =
56+
"enable_arm_streaming_ignore";
5557

5658
namespace {
5759
struct EnableArmStreamingPass
@@ -61,7 +63,9 @@ struct EnableArmStreamingPass
6163
this->enableZA = enableZA;
6264
}
6365
void runOnOperation() override {
64-
std::string attr;
66+
if (getOperation()->getAttr(kEnableArmStreamingIgnoreAttr))
67+
return;
68+
StringRef attr;
6569
switch (mode) {
6670
case ArmStreaming::Default:
6771
attr = kArmStreamingAttr;

mlir/test/Dialect/ArmSME/enable-arm-streaming.mlir

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@
99
// CHECK-ENABLE-ZA-LABEL: @arm_streaming
1010
// CHECK-ENABLE-ZA-SAME: attributes {arm_streaming, arm_za}
1111
func.func @arm_streaming() { return }
12+
13+
// CHECK-LABEL: @not_arm_streaming
14+
// CHECK-SAME: attributes {enable_arm_streaming_ignore}
15+
// CHECK-LOCALLY-LABEL: @not_arm_streaming
16+
// CHECK-LOCALLY-SAME: attributes {enable_arm_streaming_ignore}
17+
// CHECK-ENABLE-ZA-LABEL: @not_arm_streaming
18+
// CHECK-ENABLE-ZA-SAME: attributes {enable_arm_streaming_ignore}
19+
func.func @not_arm_streaming() attributes {enable_arm_streaming_ignore} { return }

0 commit comments

Comments
 (0)