I want to design an op, but this op has multiple parameters.I want each parameter to have a default value.The parameter is the ssa value.How can I do this?
It’s not clear to me what you want to achieve, you mention “default value” but also that these are “SSA operands”: where would the “default” come from?
Thank you for your reply.I did think of what you said.I think too much DefaultValuedAttr
is used here.If someone uses the scf dialect, an ssa value may be used here,for example, someone wants to use ssa value when using bScaleFactor
.But then there are other problems, some parameters(You can use default values, such as aScaleFactor, bScaleFactor ) must be written to,because aScaleFactor, bScaleFactor, before bScaleFactor.
def TileMatMul : Gemmini_Op<"tileMatMul"> {
let summary = "loop instruction.";
let arguments = (ins MemRefRankOf<[AnyType], [2]>:$aArray, MemRefRankOf<[AnyType], [2]>:$bArray,
MemRefRankOf<[AnyType], [2]>:$cArray, MemRefRankOf<[AnyType], [2]>:$dArray,
DefaultValuedAttr<F32Attr, "1.0">:$aScaleFactor, DefaultValuedAttr<F32Attr, "1.0">:$bScaleFactor,
DefaultValuedAttr<F32Attr, "1.0">:$dScaleFactor, DefaultValuedAttr<I64Attr, "0">:$act,
DefaultValuedAttr<F32Attr, "1.0">:$accScale, DefaultValuedAttr<F32Attr, "0">:$bertScale,
DefaultValuedAttr<BoolAttr, "false">:$repeatingBias, DefaultValuedAttr<BoolAttr, "false">:$aTranspose,
DefaultValuedAttr<BoolAttr, "false">:$bTranspose, DefaultValuedAttr<BoolAttr, "false">:$fullC,
DefaultValuedAttr<BoolAttr, "0">:$lowD, DefaultValuedAttr<I64Attr, "0">:$weightA);
let assemblyFormat = "$aArray $bArray $cArray $dArray attr-dict `:` type($aArray) type($bArray) type($cArray) type($dArray)";
}