diff --git a/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td b/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td index 513a9a18198a3..671cc05e963b4 100644 --- a/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td +++ b/mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td @@ -1163,7 +1163,7 @@ def MemRef_GlobalOp : MemRef_Op<"global", [Symbol]> { MemRefTypeAttr:$type, OptionalAttr:$initial_value, UnitAttr:$constant, - OptionalAttr:$alignment); + OptionalAttr>:$alignment); let assemblyFormat = [{ ($sym_visibility^)? @@ -1231,8 +1231,7 @@ def LoadOp : MemRef_Op<"load", [MemRead]>:$memref, Variadic:$indices, DefaultValuedOptionalAttr:$nontemporal, - ConfinedAttr, - [AllAttrOf<[IntPositive, IntPowerOf2]>]>:$alignment); + OptionalAttr>:$alignment); let builders = [ OpBuilder<(ins "Value":$memref, @@ -1965,8 +1964,7 @@ def MemRef_StoreOp : MemRef_Op<"store", [MemWrite]>:$memref, Variadic:$indices, DefaultValuedOptionalAttr:$nontemporal, - ConfinedAttr, - [AllAttrOf<[IntPositive, IntPowerOf2]>]>:$alignment); + OptionalAttr>:$alignment); let builders = [ OpBuilder<(ins "Value":$valueToStore, diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td index fd75532ae3d70..827ac901d22de 100644 --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td @@ -129,7 +129,7 @@ def SPIRV_KHRCooperativeMatrixLoadOp : SPIRV_KhrVendorOp<"CooperativeMatrixLoad" SPIRV_KHR_CooperativeMatrixLayoutAttr:$matrix_layout, SPIRV_Integer:$stride, OptionalAttr:$memory_operand, - OptionalAttr:$alignment + OptionalAttr>:$alignment ); let results = (outs @@ -214,7 +214,7 @@ def SPIRV_KHRCooperativeMatrixStoreOp : SPIRV_KhrVendorOp<"CooperativeMatrixStor SPIRV_KHR_CooperativeMatrixLayoutAttr:$matrix_layout, SPIRV_Integer:$stride, OptionalAttr:$memory_operand, - OptionalAttr:$alignment + OptionalAttr>:$alignment ); let results = (outs); diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td index 6253601a7c2b2..6108decdb9706 100644 --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMemoryOps.td @@ -121,9 +121,9 @@ def SPIRV_CopyMemoryOp : SPIRV_Op<"CopyMemory", []> { SPIRV_AnyPtr:$target, SPIRV_AnyPtr:$source, OptionalAttr:$memory_access, - OptionalAttr:$alignment, + OptionalAttr>:$alignment, OptionalAttr:$source_memory_access, - OptionalAttr:$source_alignment + OptionalAttr>:$source_alignment ); let results = (outs); diff --git a/mlir/test/Dialect/MemRef/invalid.mlir b/mlir/test/Dialect/MemRef/invalid.mlir index b4476036d6513..3f96d907632b7 100644 --- a/mlir/test/Dialect/MemRef/invalid.mlir +++ b/mlir/test/Dialect/MemRef/invalid.mlir @@ -380,7 +380,7 @@ func.func @mismatched_types() { // ----- -// expected-error @+1 {{alignment attribute value 63 is not a power of 2}} +// expected-error @+1 {{'memref.global' op attribute 'alignment' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive and whose value is a power of two > 0}} memref.global "private" @gv : memref<4xf32> = dense<1.0> { alignment = 63 } // -----