Skip to content

Commit f3379fe

Browse files
committed
Revert "[mlir] FunctionOpInterface: arg and result attrs dispatch to interface"
and "[flang] Fix flang after MLIR update" This reverts commit dd74e6b and 1897b67 due to ongoing test failures on flang bots e.g. https://lab.llvm.org/buildbot/#/builders/179/builds/5050
1 parent 05ff760 commit f3379fe

File tree

37 files changed

+281
-382
lines changed

37 files changed

+281
-382
lines changed

flang/lib/Optimizer/CodeGen/TargetRewrite.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,7 @@ class TargetRewrite : public fir::impl::TargetRewritePassBase<TargetRewrite> {
501501
// correctly.
502502
for (auto e : llvm::enumerate(funcTy.getInputs())) {
503503
unsigned index = e.index();
504-
llvm::ArrayRef<mlir::NamedAttribute> attrs =
505-
mlir::function_interface_impl::getArgAttrs(func, index);
504+
llvm::ArrayRef<mlir::NamedAttribute> attrs = func.getArgAttrs(index);
506505
for (mlir::NamedAttribute attr : attrs) {
507506
savedAttrs.push_back({index, attr});
508507
}

mlir/examples/toy/Ch2/include/toy/Ops.td

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ def FuncOp : Toy_Op<"func", [
134134

135135
let arguments = (ins
136136
SymbolNameAttr:$sym_name,
137-
TypeAttrOf<FunctionType>:$function_type,
138-
OptionalAttr<DictArrayAttr>:$arg_attrs,
139-
OptionalAttr<DictArrayAttr>:$res_attrs
137+
TypeAttrOf<FunctionType>:$function_type
140138
);
141139
let regions = (region AnyRegion:$body);
142140

mlir/examples/toy/Ch2/mlir/Dialect.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,8 @@ mlir::ParseResult FuncOp::parse(mlir::OpAsmParser &parser,
219219
void FuncOp::print(mlir::OpAsmPrinter &p) {
220220
// Dispatch to the FunctionOpInterface provided utility method that prints the
221221
// function operation.
222-
mlir::function_interface_impl::printFunctionOp(
223-
p, *this, /*isVariadic=*/false, getFunctionTypeAttrName(),
224-
getArgAttrsAttrName(), getResAttrsAttrName());
222+
mlir::function_interface_impl::printFunctionOp(p, *this,
223+
/*isVariadic=*/false);
225224
}
226225

227226
//===----------------------------------------------------------------------===//

mlir/examples/toy/Ch3/include/toy/Ops.td

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ def FuncOp : Toy_Op<"func", [
133133

134134
let arguments = (ins
135135
SymbolNameAttr:$sym_name,
136-
TypeAttrOf<FunctionType>:$function_type,
137-
OptionalAttr<DictArrayAttr>:$arg_attrs,
138-
OptionalAttr<DictArrayAttr>:$res_attrs
136+
TypeAttrOf<FunctionType>:$function_type
139137
);
140138
let regions = (region AnyRegion:$body);
141139

mlir/examples/toy/Ch3/mlir/Dialect.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,8 @@ mlir::ParseResult FuncOp::parse(mlir::OpAsmParser &parser,
206206
void FuncOp::print(mlir::OpAsmPrinter &p) {
207207
// Dispatch to the FunctionOpInterface provided utility method that prints the
208208
// function operation.
209-
mlir::function_interface_impl::printFunctionOp(
210-
p, *this, /*isVariadic=*/false, getFunctionTypeAttrName(),
211-
getArgAttrsAttrName(), getResAttrsAttrName());
209+
mlir::function_interface_impl::printFunctionOp(p, *this,
210+
/*isVariadic=*/false);
212211
}
213212

214213
//===----------------------------------------------------------------------===//

mlir/examples/toy/Ch4/include/toy/Ops.td

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ def FuncOp : Toy_Op<"func", [
163163

164164
let arguments = (ins
165165
SymbolNameAttr:$sym_name,
166-
TypeAttrOf<FunctionType>:$function_type,
167-
OptionalAttr<DictArrayAttr>:$arg_attrs,
168-
OptionalAttr<DictArrayAttr>:$res_attrs
166+
TypeAttrOf<FunctionType>:$function_type
169167
);
170168
let regions = (region AnyRegion:$body);
171169

mlir/examples/toy/Ch4/mlir/Dialect.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,8 @@ mlir::ParseResult FuncOp::parse(mlir::OpAsmParser &parser,
295295
void FuncOp::print(mlir::OpAsmPrinter &p) {
296296
// Dispatch to the FunctionOpInterface provided utility method that prints the
297297
// function operation.
298-
mlir::function_interface_impl::printFunctionOp(
299-
p, *this, /*isVariadic=*/false, getFunctionTypeAttrName(),
300-
getArgAttrsAttrName(), getResAttrsAttrName());
298+
mlir::function_interface_impl::printFunctionOp(p, *this,
299+
/*isVariadic=*/false);
301300
}
302301

303302
/// Returns the region on the function operation that is callable.

mlir/examples/toy/Ch5/include/toy/Ops.td

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ def FuncOp : Toy_Op<"func", [
163163

164164
let arguments = (ins
165165
SymbolNameAttr:$sym_name,
166-
TypeAttrOf<FunctionType>:$function_type,
167-
OptionalAttr<DictArrayAttr>:$arg_attrs,
168-
OptionalAttr<DictArrayAttr>:$res_attrs
166+
TypeAttrOf<FunctionType>:$function_type
169167
);
170168
let regions = (region AnyRegion:$body);
171169

mlir/examples/toy/Ch5/mlir/Dialect.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,8 @@ mlir::ParseResult FuncOp::parse(mlir::OpAsmParser &parser,
295295
void FuncOp::print(mlir::OpAsmPrinter &p) {
296296
// Dispatch to the FunctionOpInterface provided utility method that prints the
297297
// function operation.
298-
mlir::function_interface_impl::printFunctionOp(
299-
p, *this, /*isVariadic=*/false, getFunctionTypeAttrName(),
300-
getArgAttrsAttrName(), getResAttrsAttrName());
298+
mlir::function_interface_impl::printFunctionOp(p, *this,
299+
/*isVariadic=*/false);
301300
}
302301

303302
/// Returns the region on the function operation that is callable.

mlir/examples/toy/Ch6/include/toy/Ops.td

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ def FuncOp : Toy_Op<"func", [
163163

164164
let arguments = (ins
165165
SymbolNameAttr:$sym_name,
166-
TypeAttrOf<FunctionType>:$function_type,
167-
OptionalAttr<DictArrayAttr>:$arg_attrs,
168-
OptionalAttr<DictArrayAttr>:$res_attrs
166+
TypeAttrOf<FunctionType>:$function_type
169167
);
170168
let regions = (region AnyRegion:$body);
171169

0 commit comments

Comments
 (0)