Skip to content

Commit 23aa5a7

Browse files
committed
[mlir] Rename the Standard dialect to the Func dialect
The last remaining operations in the standard dialect all revolve around FuncOp/function related constructs. This patch simply handles the initial renaming (which by itself is already huge), but there are a large number of cleanups unlocked/necessary afterwards: * Removing a bunch of unnecessary dependencies on Func * Cleaning up the From/ToStandard conversion passes * Preparing for the move of FuncOp to the Func dialect See the discussion at https://discourse.llvm.org/t/standard-dialect-the-final-chapter/6061 Differential Revision: https://reviews.llvm.org/D120624
1 parent 9bf6e3e commit 23aa5a7

File tree

309 files changed

+958
-980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

309 files changed

+958
-980
lines changed

flang/include/flang/Lower/Support/Utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "flang/Common/indirection.h"
1717
#include "flang/Parser/char-block.h"
1818
#include "flang/Semantics/tools.h"
19-
#include "mlir/Dialect/StandardOps/IR/Ops.h"
19+
#include "mlir/Dialect/Func/IR/FuncOps.h"
2020
#include "mlir/IR/BuiltinAttributes.h"
2121
#include "llvm/ADT/StringRef.h"
2222
#include <cstdint>

flang/include/flang/Optimizer/Builder/Factory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "flang/Optimizer/Dialect/FIROps.h"
1919
#include "flang/Optimizer/Dialect/FIRType.h"
20-
#include "mlir/Dialect/StandardOps/IR/Ops.h"
20+
#include "mlir/Dialect/Func/IR/FuncOps.h"
2121
#include "llvm/ADT/iterator_range.h"
2222

2323
namespace mlir {

flang/include/flang/Optimizer/Builder/Runtime/Character.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef FORTRAN_OPTIMIZER_BUILDER_RUNTIME_CHARACTER_H
1010
#define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_CHARACTER_H
1111

12-
#include "mlir/Dialect/StandardOps/IR/Ops.h"
12+
#include "mlir/Dialect/Func/IR/FuncOps.h"
1313

1414
namespace fir {
1515
class ExtendedValue;

flang/include/flang/Optimizer/Builder/Runtime/Numeric.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#ifndef FORTRAN_OPTIMIZER_BUILDER_RUNTIME_NUMERIC_H
1010
#define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_NUMERIC_H
1111

12-
#include "mlir/Dialect/StandardOps/IR/Ops.h"
12+
#include "mlir/Dialect/Func/IR/FuncOps.h"
1313

1414
namespace fir {
1515
class ExtendedValue;

flang/include/flang/Optimizer/Builder/Runtime/Reduction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#ifndef FORTRAN_OPTIMIZER_BUILDER_RUNTIME_REDUCTION_H
1717
#define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_REDUCTION_H
1818

19-
#include "mlir/Dialect/StandardOps/IR/Ops.h"
19+
#include "mlir/Dialect/Func/IR/FuncOps.h"
2020

2121
namespace fir {
2222
class ExtendedValue;

flang/include/flang/Optimizer/Builder/Runtime/Transformational.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#ifndef FORTRAN_OPTIMIZER_BUILDER_RUNTIME_TRANSFORMATIONAL_H
1111
#define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_TRANSFORMATIONAL_H
1212

13-
#include "mlir/Dialect/StandardOps/IR/Ops.h"
13+
#include "mlir/Dialect/Func/IR/FuncOps.h"
1414

1515
namespace fir {
1616
class ExtendedValue;

flang/include/flang/Optimizer/Dialect/CanonicalizationPatterns.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
include "mlir/IR/OpBase.td"
1818
include "mlir/Dialect/Arithmetic/IR/ArithmeticOps.td"
19-
include "mlir/Dialect/StandardOps/IR/Ops.td"
2019
include "flang/Optimizer/Dialect/FIROps.td"
2120

2221
def IdenticalTypePred : Constraint<CPred<"$0.getType() == $1.getType()">>;

flang/include/flang/Optimizer/Dialect/FIROps.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "flang/Optimizer/Dialect/FIRType.h"
1313
#include "mlir/Dialect/Arithmetic/IR/Arithmetic.h"
14-
#include "mlir/Dialect/StandardOps/IR/Ops.h"
14+
#include "mlir/Dialect/Func/IR/FuncOps.h"
1515
#include "mlir/Interfaces/LoopLikeInterface.h"
1616
#include "mlir/Interfaces/SideEffectInterfaces.h"
1717

flang/include/flang/Optimizer/Dialect/FIROpsSupport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define FORTRAN_OPTIMIZER_DIALECT_FIROPSSUPPORT_H
1111

1212
#include "flang/Optimizer/Dialect/FIROps.h"
13-
#include "mlir/Dialect/StandardOps/IR/Ops.h"
13+
#include "mlir/Dialect/Func/IR/FuncOps.h"
1414
#include "mlir/IR/BuiltinOps.h"
1515

1616
namespace fir {
@@ -25,7 +25,7 @@ inline bool nonVolatileLoad(mlir::Operation *op) {
2525
/// return true iff the Operation is a call
2626
inline bool isaCall(mlir::Operation *op) {
2727
return isa<fir::CallOp>(op) || isa<fir::DispatchOp>(op) ||
28-
isa<mlir::CallOp>(op) || isa<mlir::CallIndirectOp>(op);
28+
isa<mlir::func::CallOp>(op) || isa<mlir::func::CallIndirectOp>(op);
2929
}
3030

3131
/// return true iff the Operation is a fir::CallOp, fir::DispatchOp,

flang/include/flang/Optimizer/Support/InitFIR.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace fir::support {
2828
mlir::AffineDialect, FIROpsDialect, mlir::acc::OpenACCDialect, \
2929
mlir::omp::OpenMPDialect, mlir::scf::SCFDialect, \
3030
mlir::arith::ArithmeticDialect, mlir::cf::ControlFlowDialect, \
31-
mlir::StandardOpsDialect, mlir::vector::VectorDialect
31+
mlir::func::FuncDialect, mlir::vector::VectorDialect
3232

3333
// The definitive list of dialects used by flang.
3434
#define FLANG_DIALECT_LIST \

0 commit comments

Comments
 (0)