Slava Zakharin 9f35657983 [flang] Lower Fortran math intrinsic operations into MLIR ops or libm calls.
Added new -lower-math-early option that defaults to 'true' that matches
the current math lowering scheme. If set to 'false', the intrinsic math
operations will be lowered to MLIR operations, which should potentially
enable more MLIR optimizations, or libm calls, if there is no corresponding
MLIR operation exists or if "precise" mode is requested.
The generated math MLIR operations are then converted to LLVM dialect
during codegen phase.

The -lower-math-early option is not exposed to users currently. I plan to
get rid of the "early" lowering completely, when "late" lowering
is robust enough to support all math intrinsics that are currently
supported via pgmath. So "late" mode will become default and -lower-math-early
option will not be needed. This will effectively eliminate the mandatory
dependency on pgmath in Fortran lowering, but this is WIP.

Differential Revision: https://reviews.llvm.org/D128385
2022-06-28 13:32:19 -07:00

31 lines
434 B
CMake

add_flang_library(FIRCodeGen
BoxedProcedure.cpp
CGOps.cpp
CodeGen.cpp
PreCGRewrite.cpp
Target.cpp
TargetRewrite.cpp
DEPENDS
FIRBuilder
FIRDialect
FIRSupport
FIROptCodeGenPassIncGen
CGOpsIncGen
LINK_LIBS
FIRBuilder
FIRDialect
FIRSupport
MLIRMathToLLVM
MLIRMathToLibm
MLIROpenMPToLLVM
MLIRLLVMToLLVMIRTranslation
MLIRTargetLLVMIRExport
LINK_COMPONENTS
AsmParser
AsmPrinter
Remarks
)