Replace operands now injected in OpBuilder

These are now injected automatically.

PiperOrigin-RevId: 336356284
This commit is contained in:
Jacques Pienaar 2020-10-09 13:38:46 -07:00 committed by TensorFlow MLIR Team
parent f6af1fc134
commit ab4c03b84b
1 changed files with 16 additions and 19 deletions

View File

@ -340,12 +340,11 @@ def HLO_StaticMemRefCastOp: Op<LHLO_Dialect, "static_memref_cast",
let arguments = (ins Arg<LHLO_Buffer, "", []>:$operand); let arguments = (ins Arg<LHLO_Buffer, "", []>:$operand);
let results = (outs Res<LHLO_Buffer, "", []>:$result); let results = (outs Res<LHLO_Buffer, "", []>:$result);
let builders = [OpBuilder< let builders = [OpBuilder<"MemRefType resultType, Value operand",
"OpBuilder &builder, OperationState &result, MemRefType resultType, " # [{
"Value operand", [{ $_state.addOperands(operand);
result.addOperands(operand); $_state.types.push_back(resultType);
result.types.push_back(resultType); }]>];
}]>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
MemRefType getType() { return getResult().getType().cast<MemRefType>(); } MemRefType getType() { return getResult().getType().cast<MemRefType>(); }
@ -386,13 +385,13 @@ def HLO_DynamicMemRefCastOp: Op<LHLO_Dialect, "dynamic_memref_cast",
); );
let results = (outs Res<LHLO_Buffer, "", []>:$result); let results = (outs Res<LHLO_Buffer, "", []>:$result);
let builders = [OpBuilder< let builders = [
"OpBuilder &builder, OperationState &result, MemRefType resultType, " # OpBuilder<"MemRefType resultType, Value operand, ValueRange sizes, "
"Value operand, ValueRange sizes, ValueRange strides", [{ "ValueRange strides", [{
result.addOperands(operand); $_state.addOperands(operand);
result.addOperands(sizes); $_state.addOperands(sizes);
result.addOperands(strides); $_state.addOperands(strides);
result.types.push_back(resultType); $_state.types.push_back(resultType);
}]>]; }]>];
let extraClassDeclaration = [{ let extraClassDeclaration = [{
@ -815,9 +814,8 @@ def FusionOp : LHLO_Op<"fusion", [SingleBlockImplicitTerminator<"TerminatorOp">]
let skipDefaultBuilders = 1; let skipDefaultBuilders = 1;
let builders = [ let builders = [
OpBuilder<"OpBuilder &builder, OperationState &result, " OpBuilder<"ArrayRef<NamedAttribute> attributes">
"ArrayRef<NamedAttribute> attributes"> ];
];
} }
def TerminatorOp : def TerminatorOp :
@ -826,9 +824,8 @@ def TerminatorOp :
let description = [{ let description = [{
Terminator operation for the LHLO dialect. Terminator operation for the LHLO dialect.
}]; }];
let builders = [OpBuilder< let builders = [OpBuilder<"ValueRange operands",
"OpBuilder &b, OperationState &result, ValueRange operands", [{ build($_builder, $_state, llvm::None, operands, llvm::None); }]
[{ build(b, result, llvm::None, operands, llvm::None); }]
>]; >];
} }