@@ -14,6 +14,7 @@ include "mlir/Interfaces/ControlFlowInterfaces.td" // BranchOpInterface
1414include "mlir/Interfaces/InferTypeOpInterface.td" // SameOperandsAndResultType
1515include "mlir/Interfaces/CallInterfaces.td" // CallOpInterface
1616include "triton/Dialect/Triton/IR/TritonOpInterfaces.td"
17+ include "mlir/IR/BuiltinAttributes.td"
1718
1819
1920//
@@ -248,13 +249,33 @@ def TT_LoadOp : TT_Op<"load", [
248249 OptionalAttr<TT_PaddingOptionAttr>:$padding,
249250 DefaultValuedAttr<TT_CacheModifierAttr, "::mlir::triton::CacheModifier::NONE">:$cache,
250251 DefaultValuedAttr<TT_EvictionPolicyAttr, "::mlir::triton::EvictionPolicy::NORMAL">:$evict,
251- DefaultValuedAttr<BoolAttr, "false">:$isVolatile
252+ DefaultValuedAttr<BoolAttr, "false">:$isVolatile,
253+ // TODO: now flagtree_hints is string, default value of an empty string (""), needed redesign
254+ DefaultValuedAttr<StrAttr, "\"\"">:$flagtree_hints
252255 );
253256
254257 let results = (outs TT_Type:$result);
255258
256259 let builders = [
257260 // A tensor of pointers or a pointer to a scalar
261+ OpBuilder<(ins "Value":$ptr, "triton::CacheModifier":$cache,
262+ "triton::EvictionPolicy":$evict, "bool":$isVolatile, "mlir::StringAttr":$flagtree_hints)>,
263+ // A tensor pointer with boundary check and padding
264+ OpBuilder<(ins "Value":$ptr, "ArrayRef<int32_t>":$boundaryCheck,
265+ "std::optional<triton::PaddingOption>":$padding, "triton::CacheModifier":$cache,
266+ "triton::EvictionPolicy":$evict, "bool":$isVolatile, "mlir::StringAttr":$flagtree_hints)>,
267+ // A tensor of pointers or a pointer to a scalar with mask
268+ OpBuilder<(ins "Value":$ptr, "Value":$mask, "triton::CacheModifier":$cache,
269+ "triton::EvictionPolicy":$evict, "bool":$isVolatile, "mlir::StringAttr":$flagtree_hints)>,
270+ // A tensor of pointers or a pointer to a scalar with mask and other
271+ OpBuilder<(ins "Value":$ptr, "Value":$mask, "Value":$other, "triton::CacheModifier":$cache,
272+ "triton::EvictionPolicy":$evict, "bool":$isVolatile, "mlir::StringAttr":$flagtree_hints)>,
273+ // A utility function to build the operation with all attributes
274+ OpBuilder<(ins "Value":$ptr, "Value":$mask, "Value":$other,
275+ "ArrayRef<int32_t>":$boundaryCheck,
276+ "std::optional<triton::PaddingOption>":$padding, "triton::CacheModifier":$cache,
277+ "triton::EvictionPolicy":$evict, "bool":$isVolatile, "mlir::StringAttr":$flagtree_hints)>,
278+ // A tensor of pointers or a pointer to a scalar
258279 OpBuilder<(ins "Value":$ptr, "triton::CacheModifier":$cache,
259280 "triton::EvictionPolicy":$evict, "bool":$isVolatile)>,
260281 // A tensor pointer with boundary check and padding
0 commit comments