FLANG
SimplifyIntrinsics.cpp File Reference
#include "flang/Optimizer/Builder/BoxValue.h"
#include "flang/Optimizer/Builder/CUFCommon.h"
#include "flang/Optimizer/Builder/FIRBuilder.h"
#include "flang/Optimizer/Builder/LowLevelIntrinsics.h"
#include "flang/Optimizer/Builder/Todo.h"
#include "flang/Optimizer/Dialect/FIROps.h"
#include "flang/Optimizer/Dialect/FIRType.h"
#include "flang/Optimizer/Dialect/Support/FIRContext.h"
#include "flang/Optimizer/HLFIR/HLFIRDialect.h"
#include "flang/Optimizer/Transforms/Passes.h"
#include "flang/Optimizer/Transforms/Utils.h"
#include "flang/Runtime/entry-names.h"
#include "flang/Support/Fortran.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/Matchers.h"
#include "mlir/IR/Operation.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "mlir/Transforms/RegionUtils.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <llvm/Support/ErrorHandling.h>
#include <mlir/Dialect/Arith/IR/Arith.h>
#include <mlir/IR/BuiltinTypes.h>
#include <mlir/IR/Location.h>
#include <mlir/IR/MLIRContext.h>
#include <mlir/IR/Value.h>
#include <mlir/Support/LLVM.h>
#include <optional>
#include "flang/Optimizer/Transforms/Passes.h.inc"

Namespaces

namespace  fir

Macros

#define GEN_PASS_DEF_SIMPLIFYINTRINSICS
#define DEBUG_TYPE   "flang-simplify-intrinsics"

Typedefs

using BodyOpGeneratorTy
using ContinueLoopGenTy

Functions

template<typename Op>
Op expectOp (mlir::Value val)

Detailed Description

This pass looks for suitable calls to runtime library for intrinsics that can be simplified/specialized and replaces with a specialized function.

For example, SUM(arr) can be specialized as a simple function with one loop, compared to the three arguments (plus file & line info) that the runtime call has - when the argument is a 1D-array (multiple loops may be needed

Typedef Documentation

◆ BodyOpGeneratorTy

using BodyOpGeneratorTy
Initial value:
llvm::function_ref<mlir::Value(
fir::FirOpBuilder &, mlir::Location, const mlir::Type &, mlir::Value,
mlir::Value)>
Definition FIRBuilder.h:55

◆ ContinueLoopGenTy

using ContinueLoopGenTy
Initial value:
llvm::function_ref<llvm::SmallVector<mlir::Value>(
fir::FirOpBuilder &, mlir::Location, mlir::Value)>