llvm/flang/lib/Lower
Kiran Chandramohan f57627f544 [Flang] Initial patch to lower a Fortran intrinsic
This patch brings in some initial changes for lowering Fortran
intrinsics. Intrinsics are generally lowered to a mix of FIR and
MLIR operations, runtime calls or LLVM intrinsics. This patch
particularly brings in the lowering of the Fortran `andi` intrinsic
to `arith.andi` in MLIR.

The significant changes are in ConvertExpr.cpp and IntrinsicCall.cpp.
Intrinsic functions occur as part of expressions. Lowering deals with this
in ConvertExpr.cpp in `genval(const Fortran::evaluate::FunctionRef<A> &funcRef)`.
The code in the above mentioned function kicks of a sequence of calls
that ultimately results in a call to the `genIand ` function in
IntrinsicCall.cpp which creates the MLIR `arith.andi` operation.

A few tests are also included.

Note: Generally intrinsics like `iand` can occur in array (elemental)
context, but since that part is not fully supported in lowering, tests
are only added for the scalar context.

This patch is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D119990

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: zacharyselk <zrselk@gmail.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Valentin Clement <clementval@gmail.com>
2022-02-22 12:46:35 +00:00
..
.clang-format
.clang-tidy
Bridge.cpp [flang] Lower simple scalar assignment 2022-02-17 18:24:30 +01:00
CallInterface.cpp [flang] Handle lowering arguments in subroutine and function 2022-02-16 20:28:07 +01:00
CMakeLists.txt [Flang] Initial patch to lower a Fortran intrinsic 2022-02-22 12:46:35 +00:00
Coarray.cpp [flang] Initial lowering for empty program 2022-01-28 22:39:58 +01:00
ConvertExpr.cpp [Flang] Initial patch to lower a Fortran intrinsic 2022-02-22 12:46:35 +00:00
ConvertType.cpp [flang] Lower simple scalar assignment 2022-02-17 18:24:30 +01:00
ConvertVariable.cpp [flang] Handle lowering arguments in subroutine and function 2022-02-16 20:28:07 +01:00
IntervalSet.h
IntrinsicCall.cpp [Flang] Initial patch to lower a Fortran intrinsic 2022-02-22 12:46:35 +00:00
Mangler.cpp [flang] Lower simple scalar assignment 2022-02-17 18:24:30 +01:00
OpenACC.cpp [flang] Initial lowering for empty program 2022-01-28 22:39:58 +01:00
OpenMP.cpp [mlir][OpenMP] Remove clauses that are not being handled 2022-02-19 01:13:05 +05:30
PFTBuilder.cpp
RTBuilder.h [flang] Improve runtime interface with C99 complex 2021-10-01 08:45:24 +02:00
Runtime.cpp [flang] Handle character constant for error code in STOP stmt 2022-02-07 12:19:55 +01:00
SymbolMap.cpp [flang] Initial lowering for empty program 2022-01-28 22:39:58 +01:00