@@ -41,6 +41,7 @@ include "mlir/Interfaces/InferTypeOpInterface.td"
4141include "mlir/Interfaces/SideEffectInterfaces.td" // Pure
4242include "TritonAMDGPUDialect.td"
4343include "TritonAMDGPUAttrDefs.td"
44+ include "TritonAMDGPUOpInterfaces.td"
4445
4546
4647class TT_AMDGPU_Op<string mnemonic, list<Trait> traits = []> :
@@ -283,6 +284,7 @@ def CondBarrierOp : TT_AMDGPU_Op<"cond_barrier"> {
283284def BufferLoadOp : TT_AMDGPU_Op<"buffer_load", [
284285 SameLoadStoreOperandsAndResultEncoding,
285286 AttrSizedOperandSegments,
287+ BufferOpInterface,
286288 TypesMatchWith<"result element type matches the pointed type of ptr", "result", "ptr", "getPointerTypeToElement($_self)">,
287289 TypesMatchWith<"result and offsets have the same shape", "result", "offsets", "getI32SameShape($_self)">,
288290 TypesMatchWith<"result and mask have the same shape", "result", "mask", "getI1SameShape($_self)",
@@ -328,6 +330,7 @@ def BufferLoadOp : TT_AMDGPU_Op<"buffer_load", [
328330
329331def BufferLoadToLocalOp : TT_AMDGPU_Op<"buffer_load_to_local", [
330332 AttrSizedOperandSegments,
333+ BufferOpInterface,
331334 TypesMatchWith<"dest element type matches pointee type of ptr", "dest", "ptr", "getPointerTypeToElement($_self)">,
332335 TypesMatchWith<"infer mask shape from offsets",
333336 "offsets", "mask", "getI1SameShape($_self)",
@@ -364,6 +367,7 @@ def BufferLoadToLocalOp : TT_AMDGPU_Op<"buffer_load_to_local", [
364367def BufferAtomicRMWOp : TT_AMDGPU_Op<"buffer_atomic_rmw", [
365368 AttrSizedOperandSegments,
366369 SameLoadStoreOperandsAndResultEncoding,
370+ BufferOpInterface,
367371 TypesMatchWith<"result element type matches the value type", "result", "value", "$_self">,
368372 TypesMatchWith<"result element type matches the pointed type of ptr", "result", "ptr", "getPointerTypeToElement($_self)">,
369373 TypesMatchWith<"result and offsets have the same shape", "result", "offsets", "getI32SameShape($_self)">,
@@ -410,6 +414,7 @@ def BufferAtomicRMWOp : TT_AMDGPU_Op<"buffer_atomic_rmw", [
410414//===----------------------------------------------------------------------===//
411415def BufferAtomicCASOp : TT_AMDGPU_Op<"buffer_atomic_cas", [
412416 SameLoadStoreOperandsAndResultEncoding,
417+ BufferOpInterface,
413418 TypesMatchWith<"result element type matches the val type", "result", "val", "$_self">,
414419 TypesMatchWith<"result element type matches the cmp type", "result", "cmp", "$_self">,
415420 TypesMatchWith<"result element type matches the pointed type of ptr", "result", "ptr", "getPointerTypeToElement($_self)">,
@@ -452,6 +457,7 @@ def BufferAtomicCASOp : TT_AMDGPU_Op<"buffer_atomic_cas", [
452457def BufferStoreOp : TT_AMDGPU_Op<"buffer_store", [
453458 AttrSizedOperandSegments,
454459 SameLoadStoreOperandsEncoding,
460+ BufferOpInterface,
455461 TypesMatchWith<"value element type matches the pointed type of ptr", "value", "ptr", "getPointerTypeToElement($_self)">,
456462 TypesMatchWith<"value and offsets have the same shape", "value", "offsets", "getI32SameShape($_self)">,
457463 TypesMatchWith<"value and mask have the same shape", "value", "mask", "getI1SameShape($_self)",
0 commit comments