Skip to content

Commit 48c9d3d

Browse files
committed
implicitbuilder
1 parent 949f3a1 commit 48c9d3d

File tree

83 files changed

+346
-235
lines changed

Some content is hidden

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

83 files changed

+346
-235
lines changed

flang/lib/Optimizer/Dialect/CUF/CUFOps.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "mlir/IR/BuiltinAttributes.h"
2222
#include "mlir/IR/BuiltinOps.h"
2323
#include "mlir/IR/Diagnostics.h"
24+
#include "mlir/IR/ImplicitLocOpBuilder.h"
2425
#include "mlir/IR/Matchers.h"
2526
#include "mlir/IR/OpDefinition.h"
2627
#include "mlir/IR/PatternMatch.h"

flang/lib/Optimizer/Dialect/FIRCG/CGOps.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "flang/Optimizer/Dialect/FIRCG/CGOps.h"
1414
#include "flang/Optimizer/Dialect/FIRDialect.h"
15+
#include "mlir/IR/ImplicitLocOpBuilder.h"
1516
#include "flang/Optimizer/Dialect/FIROps.h"
1617
#include "flang/Optimizer/Dialect/FIRType.h"
1718

flang/lib/Optimizer/Dialect/FIROps.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "mlir/IR/BuiltinAttributes.h"
2727
#include "mlir/IR/BuiltinOps.h"
2828
#include "mlir/IR/Diagnostics.h"
29+
#include "mlir/IR/ImplicitLocOpBuilder.h"
2930
#include "mlir/IR/Matchers.h"
3031
#include "mlir/IR/OpDefinition.h"
3132
#include "mlir/IR/PatternMatch.h"

flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "mlir/IR/BuiltinAttributes.h"
2121
#include "mlir/IR/BuiltinTypes.h"
2222
#include "mlir/IR/DialectImplementation.h"
23+
#include "mlir/IR/ImplicitLocOpBuilder.h"
2324
#include "mlir/IR/Matchers.h"
2425
#include "mlir/IR/OpImplementation.h"
2526
#include "llvm/ADT/APInt.h"

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "mlir/IR/Attributes.h"
1717
#include "mlir/IR/Builders.h"
1818
#include "mlir/IR/BuiltinTypes.h"
19+
#include "mlir/IR/ImplicitLocOpBuilder.h"
1920
#include "mlir/IR/OpImplementation.h"
2021
#include "mlir/IR/Operation.h"
2122
#include "mlir/IR/OperationSupport.h"
@@ -144,7 +145,8 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
144145
llvm::LogicalResult ConstantOp::verify() {
145146
// If the return type of the constant is not an unranked tensor, the shape
146147
// must match the shape of the attribute holding the data.
147-
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
148+
auto resultType =
149+
llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
148150
if (!resultType)
149151
return success();
150152

@@ -280,7 +282,8 @@ llvm::LogicalResult ReturnOp::verify() {
280282
auto resultType = results.front();
281283

282284
// Check that the result type of the function matches the operand type.
283-
if (inputType == resultType || llvm::isa<mlir::UnrankedTensorType>(inputType) ||
285+
if (inputType == resultType ||
286+
llvm::isa<mlir::UnrankedTensorType>(inputType) ||
284287
llvm::isa<mlir::UnrankedTensorType>(resultType))
285288
return mlir::success();
286289

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "mlir/IR/Attributes.h"
1717
#include "mlir/IR/Builders.h"
1818
#include "mlir/IR/BuiltinTypes.h"
19+
#include "mlir/IR/ImplicitLocOpBuilder.h"
1920
#include "mlir/IR/OpImplementation.h"
2021
#include "mlir/IR/Operation.h"
2122
#include "mlir/IR/OperationSupport.h"
@@ -144,7 +145,8 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
144145
llvm::LogicalResult ConstantOp::verify() {
145146
// If the return type of the constant is not an unranked tensor, the shape
146147
// must match the shape of the attribute holding the data.
147-
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
148+
auto resultType =
149+
llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
148150
if (!resultType)
149151
return success();
150152

@@ -280,7 +282,8 @@ llvm::LogicalResult ReturnOp::verify() {
280282
auto resultType = results.front();
281283

282284
// Check that the result type of the function matches the operand type.
283-
if (inputType == resultType || llvm::isa<mlir::UnrankedTensorType>(inputType) ||
285+
if (inputType == resultType ||
286+
llvm::isa<mlir::UnrankedTensorType>(inputType) ||
284287
llvm::isa<mlir::UnrankedTensorType>(resultType))
285288
return mlir::success();
286289

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "mlir/IR/Attributes.h"
1717
#include "mlir/IR/Builders.h"
1818
#include "mlir/IR/BuiltinTypes.h"
19+
#include "mlir/IR/ImplicitLocOpBuilder.h"
1920
#include "mlir/IR/Location.h"
2021
#include "mlir/IR/OpImplementation.h"
2122
#include "mlir/IR/OperationSupport.h"
@@ -206,7 +207,8 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
206207
llvm::LogicalResult ConstantOp::verify() {
207208
// If the return type of the constant is not an unranked tensor, the shape
208209
// must match the shape of the attribute holding the data.
209-
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
210+
auto resultType =
211+
llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
210212
if (!resultType)
211213
return success();
212214

@@ -395,7 +397,8 @@ llvm::LogicalResult ReturnOp::verify() {
395397
auto resultType = results.front();
396398

397399
// Check that the result type of the function matches the operand type.
398-
if (inputType == resultType || llvm::isa<mlir::UnrankedTensorType>(inputType) ||
400+
if (inputType == resultType ||
401+
llvm::isa<mlir::UnrankedTensorType>(inputType) ||
399402
llvm::isa<mlir::UnrankedTensorType>(resultType))
400403
return mlir::success();
401404

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "mlir/IR/Attributes.h"
1717
#include "mlir/IR/Builders.h"
1818
#include "mlir/IR/BuiltinTypes.h"
19+
#include "mlir/IR/ImplicitLocOpBuilder.h"
1920
#include "mlir/IR/Location.h"
2021
#include "mlir/IR/OpImplementation.h"
2122
#include "mlir/IR/OperationSupport.h"
@@ -206,7 +207,8 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
206207
llvm::LogicalResult ConstantOp::verify() {
207208
// If the return type of the constant is not an unranked tensor, the shape
208209
// must match the shape of the attribute holding the data.
209-
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
210+
auto resultType =
211+
llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
210212
if (!resultType)
211213
return success();
212214

@@ -395,7 +397,8 @@ llvm::LogicalResult ReturnOp::verify() {
395397
auto resultType = results.front();
396398

397399
// Check that the result type of the function matches the operand type.
398-
if (inputType == resultType || llvm::isa<mlir::UnrankedTensorType>(inputType) ||
400+
if (inputType == resultType ||
401+
llvm::isa<mlir::UnrankedTensorType>(inputType) ||
399402
llvm::isa<mlir::UnrankedTensorType>(resultType))
400403
return mlir::success();
401404

mlir/examples/toy/Ch6/mlir/Dialect.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "mlir/IR/Attributes.h"
1717
#include "mlir/IR/Builders.h"
1818
#include "mlir/IR/BuiltinTypes.h"
19+
#include "mlir/IR/ImplicitLocOpBuilder.h"
1920
#include "mlir/IR/Location.h"
2021
#include "mlir/IR/OpImplementation.h"
2122
#include "mlir/IR/OperationSupport.h"
@@ -206,7 +207,8 @@ void ConstantOp::print(mlir::OpAsmPrinter &printer) {
206207
llvm::LogicalResult ConstantOp::verify() {
207208
// If the return type of the constant is not an unranked tensor, the shape
208209
// must match the shape of the attribute holding the data.
209-
auto resultType = llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
210+
auto resultType =
211+
llvm::dyn_cast<mlir::RankedTensorType>(getResult().getType());
210212
if (!resultType)
211213
return success();
212214

@@ -395,7 +397,8 @@ llvm::LogicalResult ReturnOp::verify() {
395397
auto resultType = results.front();
396398

397399
// Check that the result type of the function matches the operand type.
398-
if (inputType == resultType || llvm::isa<mlir::UnrankedTensorType>(inputType) ||
400+
if (inputType == resultType ||
401+
llvm::isa<mlir::UnrankedTensorType>(inputType) ||
399402
llvm::isa<mlir::UnrankedTensorType>(resultType))
400403
return mlir::success();
401404

mlir/examples/toy/Ch7/mlir/Dialect.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "mlir/IR/BuiltinAttributes.h"
1919
#include "mlir/IR/BuiltinTypes.h"
2020
#include "mlir/IR/DialectImplementation.h"
21+
#include "mlir/IR/ImplicitLocOpBuilder.h"
2122
#include "mlir/IR/Location.h"
2223
#include "mlir/IR/MLIRContext.h"
2324
#include "mlir/IR/OpImplementation.h"
@@ -429,7 +430,8 @@ llvm::LogicalResult ReturnOp::verify() {
429430
auto resultType = results.front();
430431

431432
// Check that the result type of the function matches the operand type.
432-
if (inputType == resultType || llvm::isa<mlir::UnrankedTensorType>(inputType) ||
433+
if (inputType == resultType ||
434+
llvm::isa<mlir::UnrankedTensorType>(inputType) ||
433435
llvm::isa<mlir::UnrankedTensorType>(resultType))
434436
return mlir::success();
435437

0 commit comments

Comments
 (0)