[TritonIR] make other optional and remove isOtherUnspecified (#67)

[Triton] make other optional and remove isOtherUnspecified
This commit is contained in:
Shintaro Iwasaki
2022-08-18 18:19:55 -07:00
committed by GitHub
parent 192be76b3c
commit 9aa00249a6
14 changed files with 69 additions and 58 deletions

View File

@@ -73,14 +73,14 @@ def TT_LoadOp : TT_Op<"load",
TypesMatchWith<"infer mask type from result type",
"result", "mask",
"getI1SameShape($_self)">,
TypesMatchWith<"infer other type from result type",
TypesMatchWith<"infer other type from result type or none",
"result", "other",
"$_self">]> {
"$_self", "($_op.getOperands().size() == 2) || std::equal_to<>()">]> {
let summary = "load";
let arguments = (ins TT_PtrTensor:$ptr, BoolLike:$mask, TT_Type:$other,
let arguments = (ins TT_PtrTensor:$ptr, BoolLike:$mask, Optional<TT_Type>:$other,
TT_CacheModifierAttr:$cache, TT_EvictionPolicyAttr:$evict,
BoolAttr:$isVolatile, BoolAttr:$isOtherUnspecified);
BoolAttr:$isVolatile);
let results = (outs TT_Type:$result);
@@ -89,11 +89,10 @@ def TT_LoadOp : TT_Op<"load",
OpBuilder<(ins "Value":$ptr, "triton::CacheModifier":$cache,
"triton::EvictionPolicy":$evict, "bool":$isVolatile)>,
OpBuilder<(ins "Value":$ptr, "Value":$mask, "triton::CacheModifier":$cache,
"triton::EvictionPolicy":$evict, "bool":$isVolatile,
"bool":$isOtherUnspecified)>
"triton::EvictionPolicy":$evict, "bool":$isVolatile)>
];
let assemblyFormat = "$ptr`,` $mask`,` $other attr-dict `:` type($result)";
let assemblyFormat = "operands attr-dict `:` type($result)";
}
def TT_StoreOp : TT_Op<"store",

View File

@@ -48,10 +48,14 @@ def TTG_CopyAsyncOp : TTG_Op<"copy_async",
"getPointeeType($_self)">]> {
let summary = "copy async";
let arguments = (ins TT_PtrTensor:$ptr, BoolLike:$mask, TT_Type:$other,
let arguments = (ins TT_PtrTensor:$ptr, BoolLike:$mask, Optional<TT_Type>:$other,
TT_CacheModifierAttr:$cache, TT_EvictionPolicyAttr:$evict,
BoolAttr:$isVolatile,
BoolAttr:$isOtherUnspecified);
BoolAttr:$isVolatile);
let builders = [
OpBuilder<(ins "Value":$ptr, "Value":$mask, "triton::CacheModifier":$cache,
"triton::EvictionPolicy":$evict, "bool":$isVolatile)>
];
let results = (outs TT_Type:$result);