[flang][NFC] Remove obsolete IntrinsicCall helper

Remove obsolete code that has moved to the
`flang/Optimizer/Builder/Intrinsic` directory.

`genMin` is inlined in the code since it's not available
in the builder.

Reviewed By: kiranchandramohan, schweitz

Differential Revision: https://reviews.llvm.org/D118465
This commit is contained in:
Valentin Clement 2022-01-28 22:37:36 +01:00
parent 0daa72a505
commit b62e5928e4
No known key found for this signature in database
GPG Key ID: 086D54783C928776
4 changed files with 5 additions and 1377 deletions

View File

@ -1,67 +0,0 @@
//===-- Lower/IntrinsicCall.h -- lowering of intrinsics ---------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef FORTRAN_LOWER_INTRINSICCALL_H
#define FORTRAN_LOWER_INTRINSICCALL_H
#include "flang/Optimizer/Builder/FIRBuilder.h"
namespace fir {
class ExtendedValue;
}
namespace Fortran::lower {
// TODO: Expose interface to get specific intrinsic function address.
// TODO: Handle intrinsic subroutine.
// TODO: Intrinsics that do not require their arguments to be defined
// (e.g shape inquiries) might not fit in the current interface that
// requires mlir::Value to be provided.
// TODO: Error handling interface ?
// TODO: Implementation is incomplete. Many intrinsics to tbd.
/// Helper for building calls to intrinsic functions in the runtime support
/// libraries.
/// Generate the FIR+MLIR operations for the generic intrinsic \p name
/// with arguments \p args and expected result type \p resultType.
/// Returned mlir::Value is the returned Fortran intrinsic value.
fir::ExtendedValue genIntrinsicCall(fir::FirOpBuilder &, mlir::Location,
llvm::StringRef name, mlir::Type resultType,
llvm::ArrayRef<fir::ExtendedValue> args);
/// Get SymbolRefAttr of runtime (or wrapper function containing inlined
// implementation) of an unrestricted intrinsic (defined by its signature
// and generic name)
mlir::SymbolRefAttr
getUnrestrictedIntrinsicSymbolRefAttr(fir::FirOpBuilder &, mlir::Location,
llvm::StringRef name,
mlir::FunctionType signature);
//===--------------------------------------------------------------------===//
// Direct access to intrinsics that may be used by lowering outside
// of intrinsic call lowering.
//===--------------------------------------------------------------------===//
/// Generate maximum. There must be at least one argument and all arguments
/// must have the same type.
mlir::Value genMax(fir::FirOpBuilder &, mlir::Location,
llvm::ArrayRef<mlir::Value> args);
/// Generate minimum. Same constraints as genMax.
mlir::Value genMin(fir::FirOpBuilder &, mlir::Location,
llvm::ArrayRef<mlir::Value> args);
/// Generate power function x**y with given the expected
/// result type.
mlir::Value genPow(fir::FirOpBuilder &, mlir::Location, mlir::Type resultType,
mlir::Value x, mlir::Value y);
} // namespace Fortran::lower
#endif // FORTRAN_LOWER_INTRINSICCALL_H

View File

@ -5,7 +5,6 @@ add_flang_library(FortranLower
CharacterRuntime.cpp
Coarray.cpp
ConvertType.cpp
IntrinsicCall.cpp
IO.cpp
Mangler.cpp
OpenACC.cpp

View File

@ -8,7 +8,6 @@
#include "flang/Lower/CharacterExpr.h"
#include "flang/Lower/ConvertType.h"
#include "flang/Lower/IntrinsicCall.h"
#include "flang/Optimizer/Builder/DoLoopHelper.h"
//===----------------------------------------------------------------------===//
@ -244,9 +243,12 @@ void Fortran::lower::CharacterExprHelper::createAssign(
// Copy the minimum of the lhs and rhs lengths and pad the lhs remainder
// if needed.
mlir::Value copyCount = lhs.getLen();
if (!compileTimeSameLength)
if (!compileTimeSameLength) {
auto cmp = builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::slt,
lhs.getLen(), rhs.getLen());
copyCount =
Fortran::lower::genMin(builder, loc, {lhs.getLen(), rhs.getLen()});
builder.create<mlir::SelectOp>(loc, cmp, lhs.getLen(), rhs.getLen());
}
fir::CharBoxValue safeRhs = rhs;
if (needToMaterialize(rhs)) {

File diff suppressed because it is too large Load Diff