[flang-commits] [flang] 1a9dec0 - [flang] Fixed buildbot failured after D140236.
Slava Zakharin via flang-commits
flang-commits at lists.llvm.org
Sat Dec 17 13:09:22 PST 2022
Author: Slava Zakharin
Date: 2022-12-17T13:09:08-08:00
New Revision: 1a9dec0dda0064cd0035d70b6534a65856b7a212
URL: https://github.com/llvm/llvm-project/commit/1a9dec0dda0064cd0035d70b6534a65856b7a212
DIFF: https://github.com/llvm/llvm-project/commit/1a9dec0dda0064cd0035d70b6534a65856b7a212.diff
LOG: [flang] Fixed buildbot failured after D140236.
Removed unused functions searchFunctionInLibrary and getFuncOp.
Differential Revision: https://reviews.llvm.org/D140236
Added:
Modified:
flang/lib/Lower/IntrinsicCall.cpp
Removed:
################################################################################
diff --git a/flang/lib/Lower/IntrinsicCall.cpp b/flang/lib/Lower/IntrinsicCall.cpp
index 3a73b6bf7a29..883d129a3563 100644
--- a/flang/lib/Lower/IntrinsicCall.cpp
+++ b/flang/lib/Lower/IntrinsicCall.cpp
@@ -1686,44 +1686,6 @@ class FunctionDistance {
bool infinite = false; // When forbidden conversion or wrong argument number
};
-/// Build mlir::func::FuncOp from runtime symbol description and add
-/// fir.runtime attribute.
-static mlir::func::FuncOp getFuncOp(mlir::Location loc,
- fir::FirOpBuilder &builder,
- const RuntimeFunction &runtime) {
- mlir::func::FuncOp function = builder.addNamedFunction(
- loc, runtime.symbol, runtime.typeGenerator(builder.getContext()));
- function->setAttr("fir.runtime", builder.getUnitAttr());
- return function;
-}
-
-/// Select runtime function that has the smallest distance to the intrinsic
-/// function type and that will not imply narrowing arguments or extending the
-/// result.
-/// If nothing is found, the mlir::func::FuncOp will contain a nullptr.
-static mlir::func::FuncOp searchFunctionInLibrary(
- mlir::Location loc, fir::FirOpBuilder &builder,
- const Fortran::common::StaticMultimapView<RuntimeFunction> &lib,
- llvm::StringRef name, mlir::FunctionType funcType,
- const RuntimeFunction **bestNearMatch,
- FunctionDistance &bestMatchDistance) {
- std::pair<const RuntimeFunction *, const RuntimeFunction *> range =
- lib.equal_range(name);
- for (auto iter = range.first; iter != range.second && iter; ++iter) {
- const RuntimeFunction &impl = *iter;
- mlir::FunctionType implType = impl.typeGenerator(builder.getContext());
- if (funcType == implType)
- return getFuncOp(loc, builder, impl); // exact match
-
- FunctionDistance distance(funcType, implType);
- if (distance.isSmallerThan(bestMatchDistance)) {
- *bestNearMatch = &impl;
- bestMatchDistance = std::move(distance);
- }
- }
- return {};
-}
-
using RtMap = Fortran::common::StaticMultimapView<MathOperation>;
static constexpr RtMap mathOps(mathOperations);
static_assert(mathOps.Verify() && "map must be sorted");
More information about the flang-commits
mailing list