FLANG

IntrinsicCall.h
1 //===-- Lower/IntrinsicCall.h -- lowering of intrinsics ---------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef FORTRAN_LOWER_INTRINSICCALL_H
10 #define FORTRAN_LOWER_INTRINSICCALL_H
11
12 #include "flang/Lower/FIRBuilder.h"
13
14 namespace fir {
15 class ExtendedValue;
16 }
17
18 namespace Fortran::lower {
19
20 // TODO: Expose interface to get specific intrinsic function address.
21 // TODO: Handle intrinsic subroutine.
22 // TODO: Intrinsics that do not require their arguments to be defined
23 // (e.g shape inquiries) might not fit in the current interface that
24 // requires mlir::Value to be provided.
25 // TODO: Error handling interface ?
26 // TODO: Implementation is incomplete. Many intrinsics to tbd.
27
30
34 fir::ExtendedValue genIntrinsicCall(FirOpBuilder &, mlir::Location,
35 llvm::StringRef name, mlir::Type resultType,
36 llvm::ArrayRef<fir::ExtendedValue> args);
37
39 // implementation) of an unrestricted intrinsic (defined by its signature
40 // and generic name)
41 mlir::SymbolRefAttr
42 getUnrestrictedIntrinsicSymbolRefAttr(FirOpBuilder &, mlir::Location,
43 llvm::StringRef name,
44 mlir::FunctionType signature);
45
46 //===--------------------------------------------------------------------===//
47 // Direct access to intrinsics that may be used by lowering outside
48 // of intrinsic call lowering.
49 //===--------------------------------------------------------------------===//
50
53 mlir::Value genMax(FirOpBuilder &, mlir::Location,
54 llvm::ArrayRef<mlir::Value> args);
55
57 mlir::Value genMin(FirOpBuilder &, mlir::Location,
58 llvm::ArrayRef<mlir::Value> args);
59
62 mlir::Value genPow(FirOpBuilder &, mlir::Location, mlir::Type resultType,
63 mlir::Value x, mlir::Value y);
64
65 } // namespace Fortran::lower
66
67 #endif // FORTRAN_LOWER_INTRINSICCALL_H
llvm::ArrayRef
Definition: FIRType.h:20
fir::ExtendedValue
Definition: BoxValue.h:210