From 4824d0286a2fd10460e9227b204b4f0721acb8fd Mon Sep 17 00:00:00 2001 From: Emilien Bauer Date: Tue, 20 Aug 2024 17:04:28 +0100 Subject: [PATCH] dialects: Update dialects with SameSize IRDL options. (#3070) --- tests/filecheck/dialects/memref/memref_ops.mlir | 4 ++-- xdsl/dialects/memref.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/filecheck/dialects/memref/memref_ops.mlir b/tests/filecheck/dialects/memref/memref_ops.mlir index eb18358804..2a9323367e 100644 --- a/tests/filecheck/dialects/memref/memref_ops.mlir +++ b/tests/filecheck/dialects/memref/memref_ops.mlir @@ -27,7 +27,7 @@ builtin.module { %9 = "memref.memory_space_cast"(%5) : (memref<10x2xindex>) -> memref<10x2xindex, 1: i32> %10 = memref.alloc() : memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32> %11 = "memref.alloca"() {"operandSegmentSizes" = array} : () -> memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32> - %base_buffer, %offset, %sizes:2, %strides:2 = "memref.extract_strided_metadata"(%11) {"resultSegmentSizes" = array}: (memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32>) -> (memref, index, index, index, index, index) + %base_buffer, %offset, %sizes:2, %strides:2 = "memref.extract_strided_metadata"(%11) : (memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32>) -> (memref, index, index, index, index, index) %12, %13, %14 = "test.op"() : () -> (index, index, index) %15 = memref.alloc(%12) {"alignment" = 0} : memref %16 = memref.alloc(%12, %13, %14) {"alignment" = 0} : memref @@ -75,7 +75,7 @@ builtin.module { // CHECK-NEXT: %{{.*}} = "memref.memory_space_cast"(%{{.*}}) : (memref<10x2xindex>) -> memref<10x2xindex, 1 : i32> // CHECK-NEXT: %{{.*}} = memref.alloc() : memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32> // CHECK-NEXT: %{{.*}} = "memref.alloca"() <{"operandSegmentSizes" = array}> : () -> memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32> -// CHECK-NEXT: %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} = "memref.extract_strided_metadata"(%{{.*}}) {"resultSegmentSizes" = array} : (memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32>) -> (memref, index, index, index, index, index) +// CHECK-NEXT: %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} = "memref.extract_strided_metadata"(%{{.*}}) : (memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32>) -> (memref, index, index, index, index, index) // CHECK-NEXT: %{{.*}}, %{{.*}}, %{{.*}} = "test.op"() : () -> (index, index, index) // CHECK-NEXT: %{{.*}} = memref.alloc(%{{.*}}) {"alignment" = 0 : i64} : memref // CHECK-NEXT: %{{.*}} = memref.alloc(%{{.*}}, %{{.*}}, %{{.*}}) {"alignment" = 0 : i64} : memref diff --git a/xdsl/dialects/memref.py b/xdsl/dialects/memref.py index dc9d916198..cc67e1645f 100644 --- a/xdsl/dialects/memref.py +++ b/xdsl/dialects/memref.py @@ -36,11 +36,11 @@ from xdsl.ir import Attribute, Dialect, Operation, OpResult, SSAValue from xdsl.irdl import ( AttrSizedOperandSegments, - AttrSizedResultSegments, ConstraintVar, IRDLOperation, Operand, ParsePropInAttrDict, + SameVariadicResultSize, VarOperand, VarOpResult, base, @@ -548,7 +548,7 @@ class ExtractStridedMetaDataOp(IRDLOperation): traits = frozenset([NoMemoryEffect()]) - irdl_options = [AttrSizedResultSegments()] + irdl_options = [SameVariadicResultSize()] def __init__(self, source: SSAValue | Operation): """