[flang-commits] [flang] b38c04a - [fir][NFC] Rename operand of EmboxOp
Valentin Clement via flang-commits
flang-commits at lists.llvm.org
Tue Sep 28 08:01:12 PDT 2021
Author: Valentin Clement
Date: 2021-09-28T17:00:55+02:00
New Revision: b38c04ab7f8f847eac2b4b6f965137a85c967d21
URL: https://github.com/llvm/llvm-project/commit/b38c04ab7f8f847eac2b4b6f965137a85c967d21
DIFF: https://github.com/llvm/llvm-project/commit/b38c04ab7f8f847eac2b4b6f965137a85c967d21.diff
LOG: [fir][NFC] Rename operand of EmboxOp
Rename `lenParams` to `typeparams` to be in sync with fir-dev.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D110628
Co-authored-by: Jean Perier <jperier at nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz at nvidia.com>
Added:
Modified:
flang/include/flang/Optimizer/Dialect/FIROps.td
flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
flang/lib/Optimizer/Dialect/FIROps.cpp
Removed:
################################################################################
diff --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td
index 3a3112beb4ef1..cb0bee24a0902 100644
--- a/flang/include/flang/Optimizer/Dialect/FIROps.td
+++ b/flang/include/flang/Optimizer/Dialect/FIROps.td
@@ -1061,7 +1061,7 @@ def fir_EmboxOp : fir_Op<"embox", [NoSideEffect, AttrSizedOperandSegments]> {
- shape: emboxing an array may require shape information (an array's
lower bounds and extents may not be known until runtime),
- slice: an array section can be described with a slice triple,
- - lenParams: for emboxing a derived type with LEN type parameters,
+ - typeparams: for emboxing a derived type with LEN type parameters,
- accessMap: unused/experimental.
}];
@@ -1069,7 +1069,7 @@ def fir_EmboxOp : fir_Op<"embox", [NoSideEffect, AttrSizedOperandSegments]> {
AnyReferenceLike:$memref,
Optional<AnyShapeType>:$shape,
Optional<fir_SliceType>:$slice,
- Variadic<AnyIntegerType>:$lenParams,
+ Variadic<AnyIntegerType>:$typeparams,
OptionalAttr<AffineMapAttr>:$accessMap
);
@@ -1085,7 +1085,7 @@ def fir_EmboxOp : fir_Op<"embox", [NoSideEffect, AttrSizedOperandSegments]> {
];
let assemblyFormat = [{
- $memref (`(` $shape^ `)`)? (`[` $slice^ `]`)? (`typeparams` $lenParams^)?
+ $memref (`(` $shape^ `)`)? (`[` $slice^ `]`)? (`typeparams` $typeparams^)?
(`map` $accessMap^)? attr-dict `:` functional-type(operands, results)
}];
@@ -1094,8 +1094,8 @@ def fir_EmboxOp : fir_Op<"embox", [NoSideEffect, AttrSizedOperandSegments]> {
let extraClassDeclaration = [{
mlir::Value getShape() { return shape(); }
mlir::Value getSlice() { return slice(); }
- bool hasLenParams() { return !lenParams().empty(); }
- unsigned numLenParams() { return lenParams().size(); }
+ bool hasLenParams() { return !typeparams().empty(); }
+ unsigned numLenParams() { return typeparams().size(); }
}];
}
diff --git a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
index 913e42b29dbc4..448d5459db56a 100644
--- a/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
+++ b/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
@@ -99,7 +99,7 @@ class EmboxConversion : public mlir::OpRewritePattern<EmboxOp> {
}
auto xbox = rewriter.create<cg::XEmboxOp>(
loc, embox.getType(), embox.memref(), shapeOpers, llvm::None,
- llvm::None, llvm::None, embox.lenParams());
+ llvm::None, llvm::None, embox.typeparams());
LLVM_DEBUG(llvm::dbgs() << "rewriting " << embox << " to " << xbox << '\n');
rewriter.replaceOp(embox, xbox.getOperation()->getResults());
return mlir::success();
@@ -128,7 +128,7 @@ class EmboxConversion : public mlir::OpRewritePattern<EmboxOp> {
}
auto xbox = rewriter.create<cg::XEmboxOp>(
loc, embox.getType(), embox.memref(), shapeOpers, shiftOpers,
- sliceOpers, subcompOpers, embox.lenParams());
+ sliceOpers, subcompOpers, embox.typeparams());
LLVM_DEBUG(llvm::dbgs() << "rewriting " << embox << " to " << xbox << '\n');
rewriter.replaceOp(embox, xbox.getOperation()->getResults());
return mlir::success();
diff --git a/flang/lib/Optimizer/Dialect/FIROps.cpp b/flang/lib/Optimizer/Dialect/FIROps.cpp
index 1b757553ca30b..b9e0d9a2a07b9 100644
--- a/flang/lib/Optimizer/Dialect/FIROps.cpp
+++ b/flang/lib/Optimizer/Dialect/FIROps.cpp
@@ -521,7 +521,7 @@ static mlir::LogicalResult verify(fir::EmboxOp op) {
} else {
return op.emitOpError("LEN parameters require CHARACTER or derived type");
}
- for (auto lp : op.lenParams())
+ for (auto lp : op.typeparams())
if (!fir::isa_integer(lp.getType()))
return op.emitOpError("LEN parameters must be integral type");
}
More information about the flang-commits
mailing list