Skip to content

Commit

Permalink
dialects: Update dialects with SameSize IRDL options. (#3070)
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal authored Aug 20, 2024
1 parent bc1529e commit 4824d02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 4824d02

Please sign in to comment.