Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dialects: Update dialects with SameSize IRDL options. #3070

Merged
merged 12 commits into from
Aug 20, 2024
Merged
4 changes: 2 additions & 2 deletions tests/filecheck/dialects/memref/memref_ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -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<i32: 0, 0>} : () -> memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32>
%base_buffer, %offset, %sizes:2, %strides:2 = "memref.extract_strided_metadata"(%11) {"resultSegmentSizes" = array<i32: 1, 1, 2, 2>}: (memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32>) -> (memref<index>, 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, index)
%12, %13, %14 = "test.op"() : () -> (index, index, index)
%15 = memref.alloc(%12) {"alignment" = 0} : memref<?xindex>
%16 = memref.alloc(%12, %13, %14) {"alignment" = 0} : memref<?x?x?xindex>
Expand Down Expand Up @@ -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<i32: 0, 0>}> : () -> memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32>
// CHECK-NEXT: %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}} = "memref.extract_strided_metadata"(%{{.*}}) {"resultSegmentSizes" = array<i32: 1, 1, 2, 2>} : (memref<64x64xindex, strided<[2, 4], offset: 6>, 2 : i32>) -> (memref<index>, 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, index)
// CHECK-NEXT: %{{.*}}, %{{.*}}, %{{.*}} = "test.op"() : () -> (index, index, index)
// CHECK-NEXT: %{{.*}} = memref.alloc(%{{.*}}) {"alignment" = 0 : i64} : memref<?xindex>
// CHECK-NEXT: %{{.*}} = memref.alloc(%{{.*}}, %{{.*}}, %{{.*}}) {"alignment" = 0 : i64} : memref<?x?x?xindex>
Expand Down
4 changes: 2 additions & 2 deletions xdsl/dialects/memref.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -548,7 +548,7 @@ class ExtractStridedMetaDataOp(IRDLOperation):

traits = frozenset([NoMemoryEffect()])

irdl_options = [AttrSizedResultSegments()]
irdl_options = [SameVariadicResultSize()]

def __init__(self, source: SSAValue | Operation):
"""
Expand Down
Loading