FLANG
|
Namespaces | |
namespace | builtin |
Typedefs | |
using | SomeExpr = Fortran::evaluate::Expr< Fortran::evaluate::SomeType > |
using | SymbolRef = Fortran::common::Reference< const Fortran::semantics::Symbol > |
using | TypeConstructionStack = llvm::DenseMap< const Fortran::semantics::Scope *, mlir::Type > |
using | ExprToValueMap = llvm::DenseMap< const SomeExpr *, mlir::Value > |
using | PathComponent = std::variant< const evaluate::ArrayRef *, const evaluate::Component *, const evaluate::ComplexPart *, details::ImplicitSubscripts > |
using | LoweredResult = std::variant< fir::ExtendedValue, hlfir::EntityWithAttributes > |
using | LenParameterTy = std::int64_t |
using | AggregateStoreKey = std::tuple< const Fortran::semantics::Scope *, std::size_t > |
using | AggregateStoreMap = llvm::DenseMap< AggregateStoreKey, mlir::Value > |
using | OperandPrepare = std::function< void(const Fortran::lower::SomeExpr &)> |
using | OperandPrepareAs = std::function< void(const Fortran::lower::SomeExpr &, fir::LowerIntrinsicArgAs)> |
using | OperandPresent = std::function< std::optional< mlir::Value >(std::size_t)> |
using | OperandGetter = std::function< fir::ExtendedValue(std::size_t, bool)> |
using | PreparedActualArguments = llvm::SmallVector< std::optional< PreparedActualArgument > > |
using | FrontEndExpr = const evaluate::Expr< evaluate::SomeType > * |
using | FrontEndSymbol = const semantics::Symbol * |
using | GenerateElementalArrayFunc = std::function< fir::ExtendedValue(const IterationSpace &)> |
using | ExplicitSpaceArrayBases = std::variant< FrontEndSymbol, const evaluate::Component *, const evaluate::ArrayRef * > |
using | AccRoutineInfoMappingList = llvm::SmallVector< std::pair< std::string, mlir::SymbolRefAttr > > |
Functions | |
bool | isArraySectionWithoutVectorSubscript (const SomeExpr &expr) |
void | genAllocateStmt (AbstractConverter &converter, const parser::AllocateStmt &stmt, mlir::Location loc) |
Lower an allocate statement to fir. | |
void | genDeallocateStmt (AbstractConverter &converter, const parser::DeallocateStmt &stmt, mlir::Location loc) |
Lower a deallocate statement to fir. | |
void | genDeallocateBox (AbstractConverter &converter, const fir::MutableBoxValue &box, mlir::Location loc, const Fortran::semantics::Symbol *sym=nullptr, mlir::Value declaredTypeDesc={}) |
void | genDeallocateIfAllocated (AbstractConverter &converter, const fir::MutableBoxValue &box, mlir::Location loc, const Fortran::semantics::Symbol *sym=nullptr) |
Deallocate an allocatable if it is allocated at the end of its lifetime. | |
fir::MutableBoxValue | createMutableBox (AbstractConverter &converter, mlir::Location loc, const pft::Variable &var, mlir::Value boxAddr, mlir::ValueRange nonDeferredParams, bool alwaysUseBox, unsigned allocator=kDefaultAllocator) |
void | associateMutableBox (AbstractConverter &converter, mlir::Location loc, const fir::MutableBoxValue &box, const SomeExpr &source, mlir::ValueRange lbounds, StatementContext &stmtCtx) |
bool | isWholeAllocatable (const SomeExpr &expr) |
Is expr a reference to an entity with the ALLOCATABLE attribute? | |
bool | isWholePointer (const SomeExpr &expr) |
Is expr a reference to an entity with the POINTER attribute? | |
mlir::Value | getAssumedCharAllocatableOrPointerLen (fir::FirOpBuilder &builder, mlir::Location loc, const Fortran::semantics::Symbol &sym, mlir::Value box) |
mlir::Value | getTypeDescAddr (AbstractConverter &converter, mlir::Location loc, const Fortran::semantics::DerivedTypeSpec &typeSpec) |
Retrieve the address of a type descriptor from its derived type spec. | |
bool | symIsChar (const Fortran::semantics::Symbol &sym) |
bool | symIsArray (const Fortran::semantics::Symbol &sym) |
bool | isExplicitShape (const Fortran::semantics::Symbol &sym) |
bool | isAssumedSize (const Fortran::semantics::Symbol &sym) |
mlir::FunctionType | translateSignature (const Fortran::evaluate::ProcedureDesignator &, Fortran::lower::AbstractConverter &) |
Translate a procedure characteristics to an mlir::FunctionType signature. | |
mlir::func::FuncOp | getOrDeclareFunction (const Fortran::evaluate::ProcedureDesignator &, Fortran::lower::AbstractConverter &) |
mlir::Type | getDummyProcedureType (const Fortran::semantics::Symbol &dummyProc, Fortran::lower::AbstractConverter &) |
mlir::Type | getUntypedBoxProcType (mlir::MLIRContext *context) |
Return !fir.boxproc<() -> ()> type. | |
bool | isCPtrArgByValueType (mlir::Type ty) |
bool | mustPassLengthWithDummyProcedure (const Fortran::evaluate::ProcedureDesignator &proc, Fortran::lower::AbstractConverter &) |
Is it required to pass proc as a tuple<function address, result length> ? | |
void | genChangeTeamConstruct (AbstractConverter &, pft::Evaluation &eval, const parser::ChangeTeamConstruct &) |
void | genChangeTeamStmt (AbstractConverter &, pft::Evaluation &eval, const parser::ChangeTeamStmt &) |
void | genEndChangeTeamStmt (AbstractConverter &, pft::Evaluation &eval, const parser::EndChangeTeamStmt &) |
void | genFormTeamStatement (AbstractConverter &, pft::Evaluation &eval, const parser::FormTeamStmt &) |
bool | isRankedArrayAccess (const Fortran::evaluate::ArrayRef &x) |
std::pair< LoweredResult, bool > | genCallOpAndResult (mlir::Location loc, Fortran::lower::AbstractConverter &converter, Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx, Fortran::lower::CallerInterface &caller, mlir::FunctionType callSiteType, std::optional< mlir::Type > resultType, bool isElemental=false) |
mlir::Value | argumentHostAssocs (Fortran::lower::AbstractConverter &converter, mlir::Value arg) |
bool | isIntrinsicModuleProcRef (const Fortran::evaluate::ProcedureRef &procRef) |
std::optional< hlfir::EntityWithAttributes > | convertCallToHLFIR (mlir::Location loc, Fortran::lower::AbstractConverter &converter, const evaluate::ProcedureRef &procRef, std::optional< mlir::Type > resultType, Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) |
void | convertUserDefinedAssignmentToHLFIR (mlir::Location loc, Fortran::lower::AbstractConverter &converter, const evaluate::ProcedureRef &procRef, hlfir::Entity lhs, hlfir::Entity rhs, Fortran::lower::SymMap &symMap) |
template<typename T > | |
fir::ExtendedValue | convertConstant (Fortran::lower::AbstractConverter &converter, mlir::Location loc, const evaluate::Constant< T > &constant, bool outlineBigConstantsInReadOnlyMemory) |
fir::GlobalOp | tryCreatingDenseGlobal (fir::FirOpBuilder &builder, mlir::Location loc, mlir::Type symTy, llvm::StringRef globalName, mlir::StringAttr linkage, bool isConst, const Fortran::lower::SomeExpr &initExpr, cuf::DataAttributeAttr dataAttr={}) |
fir::ExtendedValue | genInlinedStructureCtorLit (Fortran::lower::AbstractConverter &converter, mlir::Location loc, const Fortran::evaluate::StructureConstructor &ctor) |
fir::ExtendedValue | createSomeExtendedExpression (mlir::Location loc, AbstractConverter &converter, const SomeExpr &expr, SymMap &symMap, StatementContext &stmtCtx) |
Create an extended expression value. | |
fir::ExtendedValue | createSomeInitializerExpression (mlir::Location loc, AbstractConverter &converter, const SomeExpr &expr, SymMap &symMap, StatementContext &stmtCtx) |
fir::ExtendedValue | createSomeExtendedAddress (mlir::Location loc, AbstractConverter &converter, const SomeExpr &expr, SymMap &symMap, StatementContext &stmtCtx) |
Create an extended expression address. | |
fir::ExtendedValue | createInitializerAddress (mlir::Location loc, AbstractConverter &converter, const SomeExpr &expr, SymMap &symMap, StatementContext &stmtCtx) |
fir::MutableBoxValue | createMutableBox (mlir::Location loc, AbstractConverter &converter, const SomeExpr &expr, SymMap &symMap) |
bool | isParentComponent (const SomeExpr &expr) |
Return true iff the expression is pointing to a parent component. | |
fir::ExtendedValue | updateBoxForParentComponent (AbstractConverter &converter, fir::ExtendedValue exv, const SomeExpr &expr) |
Update the extended value to represent the parent component. | |
fir::ExtendedValue | createBoxValue (mlir::Location loc, AbstractConverter &converter, const SomeExpr &expr, SymMap &symMap, StatementContext &stmtCtx) |
void | createSomeArrayAssignment (AbstractConverter &converter, const SomeExpr &lhs, const SomeExpr &rhs, SymMap &symMap, StatementContext &stmtCtx) |
void | createSomeArrayAssignment (AbstractConverter &converter, const fir::ExtendedValue &lhs, const SomeExpr &rhs, SymMap &symMap, StatementContext &stmtCtx) |
void | createSomeArrayAssignment (AbstractConverter &converter, const fir::ExtendedValue &lhs, const fir::ExtendedValue &rhs, SymMap &symMap, StatementContext &stmtCtx) |
void | createAnyMaskedArrayAssignment (AbstractConverter &converter, const SomeExpr &lhs, const SomeExpr &rhs, ExplicitIterSpace &explicitIterSpace, ImplicitIterSpace &implicitIterSpace, SymMap &symMap, StatementContext &stmtCtx) |
void | createAllocatableArrayAssignment (AbstractConverter &converter, const SomeExpr &lhs, const SomeExpr &rhs, ExplicitIterSpace &explicitIterSpace, ImplicitIterSpace &implicitIterSpace, SymMap &symMap, StatementContext &stmtCtx) |
void | createArrayOfPointerAssignment (AbstractConverter &converter, const SomeExpr &lhs, const SomeExpr &rhs, ExplicitIterSpace &explicitIterSpace, ImplicitIterSpace &implicitIterSpace, const llvm::SmallVector< mlir::Value > &lbounds, std::optional< llvm::SmallVector< mlir::Value > > ubounds, SymMap &symMap, StatementContext &stmtCtx) |
fir::ExtendedValue | createSomeArrayTempValue (AbstractConverter &converter, const SomeExpr &expr, SymMap &symMap, StatementContext &stmtCtx) |
void | createLazyArrayTempValue (AbstractConverter &converter, const SomeExpr &expr, mlir::Value raggedHeader, SymMap &symMap, StatementContext &stmtCtx) |
fir::ExtendedValue | createSomeArrayBox (AbstractConverter &converter, const SomeExpr &expr, SymMap &symMap, StatementContext &stmtCtx) |
mlir::Value | createSubroutineCall (AbstractConverter &converter, const evaluate::ProcedureRef &call, ExplicitIterSpace &explicitIterSpace, ImplicitIterSpace &implicitIterSpace, SymMap &symMap, StatementContext &stmtCtx, bool isUserDefAssignment) |
mlir::Value | addCrayPointerInst (mlir::Location loc, fir::FirOpBuilder &builder, mlir::Value ptrVal, mlir::Type ptrTy, mlir::Type pteTy) |
hlfir::EntityWithAttributes | convertExprToHLFIR (mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &) |
fir::ExtendedValue | translateToExtendedValue (mlir::Location loc, fir::FirOpBuilder &builder, hlfir::Entity entity, Fortran::lower::StatementContext &context, bool contiguityHint=false) |
fir::ExtendedValue | convertExprToBox (mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &) |
fir::ExtendedValue | convertToBox (mlir::Location loc, Fortran::lower::AbstractConverter &, hlfir::Entity entity, Fortran::lower::StatementContext &, mlir::Type fortranType) |
fir::ExtendedValue | convertExprToAddress (mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &) |
fir::ExtendedValue | convertToAddress (mlir::Location loc, Fortran::lower::AbstractConverter &, hlfir::Entity entity, Fortran::lower::StatementContext &, mlir::Type fortranType) |
fir::ExtendedValue | convertExprToValue (mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &) |
Lower an evaluate::Expr to a fir::ExtendedValue value. | |
fir::ExtendedValue | convertToValue (mlir::Location loc, Fortran::lower::AbstractConverter &, hlfir::Entity entity, Fortran::lower::StatementContext &) |
fir::ExtendedValue | convertDataRefToValue (mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::evaluate::DataRef &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &) |
fir::MutableBoxValue | convertExprToMutableBox (mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &) |
hlfir::ElementalAddrOp | convertVectorSubscriptedExprToElementalAddr (mlir::Location loc, Fortran::lower::AbstractConverter &, const Fortran::lower::SomeExpr &, Fortran::lower::SymMap &, Fortran::lower::StatementContext &) |
fir::ExtendedValue | convertProcedureDesignator (mlir::Location loc, Fortran::lower::AbstractConverter &converter, const Fortran::evaluate::ProcedureDesignator &proc, Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) |
hlfir::EntityWithAttributes | convertProcedureDesignatorToHLFIR (mlir::Location loc, Fortran::lower::AbstractConverter &converter, const Fortran::evaluate::ProcedureDesignator &proc, Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) |
mlir::Value | convertProcedureDesignatorInitialTarget (Fortran::lower::AbstractConverter &, mlir::Location, const Fortran::semantics::Symbol &sym) |
Generate initialization for procedure pointer to procedure target. | |
mlir::Value | derefPassProcPointerComponent (mlir::Location loc, Fortran::lower::AbstractConverter &converter, const Fortran::evaluate::ProcedureDesignator &proc, mlir::Value passedArg, Fortran::lower::SymMap &symMap, Fortran::lower::StatementContext &stmtCtx) |
mlir::Type | getFIRType (mlir::MLIRContext *ctxt, common::TypeCategory tc, int kind, llvm::ArrayRef< LenParameterTy >) |
Get a FIR type based on a category and kind. | |
mlir::Type | translateDerivedTypeToFIRType (Fortran::lower::AbstractConverter &, const Fortran::semantics::DerivedTypeSpec &) |
Get a FIR type for a derived type. | |
mlir::Type | translateSomeExprToFIRType (Fortran::lower::AbstractConverter &, const SomeExpr &expr) |
Translate a SomeExpr to an mlir::Type. | |
mlir::Type | translateSymbolToFIRType (Fortran::lower::AbstractConverter &, const SymbolRef symbol) |
Translate a Fortran::semantics::Symbol to an mlir::Type. | |
mlir::Type | translateVariableToFIRType (Fortran::lower::AbstractConverter &, const pft::Variable &variable) |
Translate a Fortran::lower::pft::Variable to an mlir::Type. | |
mlir::Type | convertReal (mlir::MLIRContext *ctxt, int KIND) |
Translate a REAL of KIND to the mlir::Type. | |
bool | isDerivedTypeWithLenParameters (const semantics::Symbol &) |
void | instantiateVariable (AbstractConverter &, const pft::Variable &var, SymMap &symMap, AggregateStoreMap &storeMap) |
bool | hasDefaultInitialization (const Fortran::semantics::Symbol &sym) |
Does this variable have a default initialization? | |
void | defaultInitializeAtRuntime (Fortran::lower::AbstractConverter &converter, const Fortran::semantics::Symbol &sym, Fortran::lower::SymMap &symMap) |
Call default initialization runtime routine to initialize var . | |
void | initializeCloneAtRuntime (Fortran::lower::AbstractConverter &converter, const Fortran::semantics::Symbol &sym, Fortran::lower::SymMap &symMap) |
Call clone initialization runtime routine to initialize sym's value. | |
void | defineModuleVariable (AbstractConverter &, const pft::Variable &var) |
void | defineCommonBlocks (AbstractConverter &, const std::vector< std::pair< semantics::SymbolRef, std::size_t > > &commonBlocks) |
mlir::Value | genCommonBlockMember (AbstractConverter &converter, mlir::Location loc, const Fortran::semantics::Symbol &sym, mlir::Value commonValue) |
void | mapSymbolAttributes (AbstractConverter &, const pft::Variable &, SymMap &, StatementContext &, mlir::Value preAlloc={}) |
void | mapSymbolAttributes (AbstractConverter &, const semantics::SymbolRef &, SymMap &, StatementContext &, mlir::Value preAlloc={}) |
void | mapCallInterfaceSymbolsForResult (AbstractConverter &, const Fortran::lower::CallerInterface &caller, SymMap &symMap) |
void | mapCallInterfaceSymbolsForDummyArgument (AbstractConverter &, const Fortran::lower::CallerInterface &caller, SymMap &symMap, const Fortran::semantics::Symbol &dummySymbol) |
mlir::Value | genInitialDataTarget (Fortran::lower::AbstractConverter &, mlir::Location, mlir::Type boxType, const SomeExpr &initialTarget, bool couldBeInEquivalence=false) |
create initial-data-target fir.box in a global initializer region. | |
void | createGlobalInitialization (fir::FirOpBuilder &builder, fir::GlobalOp global, std::function< void(fir::FirOpBuilder &)> genInit) |
Call genInit to generate code inside global initializer region. | |
fir::ExtendedValue | genExtAddrInInitializer (Fortran::lower::AbstractConverter &converter, mlir::Location loc, const SomeExpr &addr) |
Generate address addr inside an initializer. | |
void | createIntrinsicModuleGlobal (Fortran::lower::AbstractConverter &converter, const pft::Variable &) |
Create a global variable for an intrinsic module object. | |
void | createRuntimeTypeInfoGlobal (Fortran::lower::AbstractConverter &converter, const Fortran::semantics::Symbol &typeInfoSym) |
fir::FortranVariableFlagsAttr | translateSymbolAttributes (mlir::MLIRContext *mlirContext, const Fortran::semantics::Symbol &sym, fir::FortranVariableFlagsEnum extraFlags=fir::FortranVariableFlagsEnum::None) |
cuf::DataAttributeAttr | translateSymbolCUFDataAttribute (mlir::MLIRContext *mlirContext, const Fortran::semantics::Symbol &sym) |
void | genDeclareSymbol (Fortran::lower::AbstractConverter &converter, Fortran::lower::SymMap &symMap, const Fortran::semantics::Symbol &sym, const fir::ExtendedValue &exv, fir::FortranVariableFlagsEnum extraFlags=fir::FortranVariableFlagsEnum::None, bool force=false) |
mlir::Type | getCrayPointeeBoxType (mlir::Type) |
bool | intrinsicRequiresCustomOptionalHandling (const Fortran::evaluate::ProcedureRef &procRef, const Fortran::evaluate::SpecificIntrinsic &intrinsic, AbstractConverter &converter) |
void | prepareCustomIntrinsicArgument (const Fortran::evaluate::ProcedureRef &procRef, const Fortran::evaluate::SpecificIntrinsic &intrinsic, std::optional< mlir::Type > retTy, const OperandPrepare &prepareOptionalArgument, const OperandPrepareAs &prepareOtherArgument, AbstractConverter &converter) |
fir::ExtendedValue | lowerCustomIntrinsic (fir::FirOpBuilder &builder, mlir::Location loc, llvm::StringRef name, std::optional< mlir::Type > retTy, const OperandPresent &isPresentCheck, const OperandGetter &getOperand, std::size_t numOperands, Fortran::lower::StatementContext &stmtCtx) |
fir::ExtendedValue | genIntrinsicCall (fir::FirOpBuilder &builder, mlir::Location loc, llvm::StringRef name, std::optional< mlir::Type > resultType, llvm::ArrayRef< fir::ExtendedValue > args, StatementContext &stmtCtx, Fortran::lower::AbstractConverter *converter=nullptr) |
template<typename AtomicT , typename AtomicListT > | |
void | genOmpAccAtomicWrite (Fortran::lower::AbstractConverter &converter, const AtomicT &atomicWrite, mlir::Location loc) |
Processes an atomic construct with write clause. | |
template<typename AtomicT , typename AtomicListT > | |
void | genOmpAccAtomicRead (Fortran::lower::AbstractConverter &converter, const AtomicT &atomicRead, mlir::Location loc) |
Processes an atomic construct with read clause. | |
template<typename AtomicT , typename AtomicListT > | |
void | genOmpAccAtomicUpdate (Fortran::lower::AbstractConverter &converter, const AtomicT &atomicUpdate, mlir::Location loc) |
Processes an atomic construct with update clause. | |
template<typename AtomicT , typename AtomicListT > | |
void | genOmpAtomic (Fortran::lower::AbstractConverter &converter, const AtomicT &atomicConstruct, mlir::Location loc) |
Processes an atomic construct with no clause - which implies update clause. | |
template<typename AtomicT , typename AtomicListT > | |
void | genOmpAccAtomicCapture (Fortran::lower::AbstractConverter &converter, const AtomicT &atomicCapture, mlir::Location loc) |
Processes an atomic construct with capture clause. | |
template<typename... TerminatorOps> | |
void | createEmptyRegionBlocks (fir::FirOpBuilder &builder, std::list< Fortran::lower::pft::Evaluation > &evaluationList) |
AddrAndBoundsInfo | getDataOperandBaseAddr (fir::FirOpBuilder &builder, mlir::Value symAddr, bool isOptional, mlir::Location loc) |
AddrAndBoundsInfo | getDataOperandBaseAddr (Fortran::lower::AbstractConverter &converter, fir::FirOpBuilder &builder, Fortran::lower::SymbolRef sym, mlir::Location loc) |
template<typename BoundsOp , typename BoundsType > | |
llvm::SmallVector< mlir::Value > | gatherBoundsOrBoundValues (fir::FirOpBuilder &builder, mlir::Location loc, fir::ExtendedValue dataExv, mlir::Value box, bool collectValuesOnly=false) |
template<typename BoundsOp , typename BoundsType > | |
llvm::SmallVector< mlir::Value > | genBoundsOpsFromBox (fir::FirOpBuilder &builder, mlir::Location loc, fir::ExtendedValue dataExv, Fortran::lower::AddrAndBoundsInfo &info) |
Generate the bounds operation from the descriptor information. | |
template<typename BoundsOp , typename BoundsType > | |
llvm::SmallVector< mlir::Value > | genBaseBoundsOps (fir::FirOpBuilder &builder, mlir::Location loc, fir::ExtendedValue dataExv, bool isAssumedSize) |
template<typename BoundsOp , typename BoundsType > | |
llvm::SmallVector< mlir::Value > | genBoundsOps (fir::FirOpBuilder &builder, mlir::Location loc, Fortran::lower::AbstractConverter &converter, Fortran::lower::StatementContext &stmtCtx, const std::vector< Fortran::evaluate::Subscript > &subscripts, std::stringstream &asFortran, fir::ExtendedValue &dataExv, bool dataExvIsAssumedSize, AddrAndBoundsInfo &info, bool treatIndexAsSection=false) |
template<typename BoundsOp , typename BoundsType > | |
AddrAndBoundsInfo | gatherDataOperandAddrAndBounds (Fortran::lower::AbstractConverter &converter, fir::FirOpBuilder &builder, semantics::SemanticsContext &semaCtx, Fortran::lower::StatementContext &stmtCtx, Fortran::semantics::SymbolRef symbol, const Fortran::semantics::MaybeExpr &maybeDesignator, mlir::Location operandLocation, std::stringstream &asFortran, llvm::SmallVector< mlir::Value > &bounds, bool treatIndexAsSection=false) |
template<typename BoundsOp , typename BoundsType > | |
llvm::SmallVector< mlir::Value > | genImplicitBoundsOps (fir::FirOpBuilder &builder, lower::AddrAndBoundsInfo &info, fir::ExtendedValue dataExv, bool dataExvIsAssumedSize, mlir::Location loc) |
LLVM_DUMP_METHOD void | dumpEvExpr (const Fortran::evaluate::Expr< Fortran::evaluate::SomeType > &x) |
LLVM_DUMP_METHOD void | dumpEvExpr (const Fortran::evaluate::Expr< Fortran::evaluate::Type< Fortran::common::TypeCategory::Integer, 4 > > &x) |
LLVM_DUMP_METHOD void | dumpEvExpr (const Fortran::evaluate::Expr< Fortran::evaluate::Type< Fortran::common::TypeCategory::Integer, 8 > > &x) |
LLVM_DUMP_METHOD void | dumpEvExpr (const Fortran::evaluate::ArrayRef &x) |
LLVM_DUMP_METHOD void | dumpEvExpr (const Fortran::evaluate::DataRef &x) |
LLVM_DUMP_METHOD void | dumpEvExpr (const Fortran::evaluate::Substring &x) |
LLVM_DUMP_METHOD void | dumpEvExpr (const Fortran::evaluate::Designator< Fortran::evaluate::Type< Fortran::common::TypeCategory::Integer, 4 > > &x) |
std::optional< hlfir::EntityWithAttributes > | lowerHlfirIntrinsic (fir::FirOpBuilder &builder, mlir::Location loc, const std::string &name, const Fortran::lower::PreparedActualArguments &loweredActuals, const fir::IntrinsicArgumentLoweringRules *argLowering, mlir::Type stmtResultType) |
mlir::Value | genBackspaceStatement (AbstractConverter &, const parser::BackspaceStmt &) |
Generate IO call(s) for BACKSPACE; return the IOSTAT code. | |
mlir::Value | genCloseStatement (AbstractConverter &, const parser::CloseStmt &) |
Generate IO call(s) for CLOSE; return the IOSTAT code. | |
mlir::Value | genEndfileStatement (AbstractConverter &, const parser::EndfileStmt &) |
Generate IO call(s) for ENDFILE; return the IOSTAT code. | |
mlir::Value | genFlushStatement (AbstractConverter &, const parser::FlushStmt &) |
Generate IO call(s) for FLUSH; return the IOSTAT code. | |
mlir::Value | genInquireStatement (AbstractConverter &, const parser::InquireStmt &) |
Generate IO call(s) for INQUIRE; return the IOSTAT code. | |
mlir::Value | genReadStatement (AbstractConverter &converter, const parser::ReadStmt &stmt) |
Generate IO call(s) for READ; return the IOSTAT code. | |
mlir::Value | genOpenStatement (AbstractConverter &, const parser::OpenStmt &) |
Generate IO call(s) for OPEN; return the IOSTAT code. | |
void | genPrintStatement (AbstractConverter &converter, const parser::PrintStmt &stmt) |
Generate IO call(s) for PRINT. | |
mlir::Value | genRewindStatement (AbstractConverter &, const parser::RewindStmt &) |
Generate IO call(s) for REWIND; return the IOSTAT code. | |
mlir::Value | genWaitStatement (AbstractConverter &, const parser::WaitStmt &) |
Generate IO call(s) for WAIT; return the IOSTAT code. | |
mlir::Value | genWriteStatement (AbstractConverter &converter, const parser::WriteStmt &stmt) |
Generate IO call(s) for WRITE; return the IOSTAT code. | |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &, const ImplicitIterSpace &) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &, const ExplicitIterSpace &) |
void | createArrayLoads (AbstractConverter &converter, ExplicitIterSpace &esp, SymMap &symMap) |
void | createArrayMergeStores (AbstractConverter &converter, ExplicitIterSpace &esp) |
unsigned | getHashValue (const ExplicitSpaceArrayBases &x) |
bool | isEqual (const ExplicitSpaceArrayBases &x, const ExplicitSpaceArrayBases &y) |
template<typename A > | |
bool | symbolSetsIntersect (llvm::ArrayRef< FrontEndSymbol > ctrlSet, const A &exprSyms) |
template<typename A > | |
bool | symbolsIntersectSubscripts (llvm::ArrayRef< FrontEndSymbol > ctrlSet, const A &subscripts) |
mlir::Value | genOpenACCConstruct (AbstractConverter &, Fortran::semantics::SemanticsContext &, pft::Evaluation &, const parser::OpenACCConstruct &) |
void | genOpenACCDeclarativeConstruct (AbstractConverter &, Fortran::semantics::SemanticsContext &, StatementContext &, const parser::OpenACCDeclarativeConstruct &, AccRoutineInfoMappingList &) |
void | genOpenACCRoutineConstruct (AbstractConverter &, Fortran::semantics::SemanticsContext &, mlir::ModuleOp, const parser::OpenACCRoutineConstruct &, AccRoutineInfoMappingList &) |
void | finalizeOpenACCRoutineAttachment (mlir::ModuleOp, AccRoutineInfoMappingList &) |
mlir::acc::PrivateRecipeOp | createOrGetPrivateRecipe (mlir::OpBuilder &, llvm::StringRef, mlir::Location, mlir::Type) |
mlir::acc::ReductionRecipeOp | createOrGetReductionRecipe (fir::FirOpBuilder &, llvm::StringRef, mlir::Location, mlir::Type, mlir::acc::ReductionOperator, llvm::SmallVector< mlir::Value > &) |
mlir::acc::FirstprivateRecipeOp | createOrGetFirstprivateRecipe (mlir::OpBuilder &, llvm::StringRef, mlir::Location, mlir::Type, llvm::SmallVector< mlir::Value > &) |
void | attachDeclarePostAllocAction (AbstractConverter &, fir::FirOpBuilder &, const Fortran::semantics::Symbol &) |
void | attachDeclarePreDeallocAction (AbstractConverter &, fir::FirOpBuilder &, mlir::Value beginOpValue, const Fortran::semantics::Symbol &) |
void | attachDeclarePostDeallocAction (AbstractConverter &, fir::FirOpBuilder &, const Fortran::semantics::Symbol &) |
void | genOpenACCTerminator (fir::FirOpBuilder &, mlir::Operation *, mlir::Location) |
int64_t | getCollapseValue (const Fortran::parser::AccClauseList &) |
bool | isInOpenACCLoop (fir::FirOpBuilder &) |
void | setInsertionPointAfterOpenACCLoopIfInside (fir::FirOpBuilder &) |
void | genEarlyReturnInOpenACCLoop (fir::FirOpBuilder &, mlir::Location) |
mlir::Operation * | genOpenMPTerminator (fir::FirOpBuilder &, mlir::Operation *, mlir::Location) |
void | genOpenMPConstruct (AbstractConverter &, Fortran::lower::SymMap &, semantics::SemanticsContext &, pft::Evaluation &, const parser::OpenMPConstruct &) |
void | genOpenMPDeclarativeConstruct (AbstractConverter &, Fortran::lower::SymMap &, semantics::SemanticsContext &, pft::Evaluation &, const parser::OpenMPDeclarativeConstruct &) |
void | genOpenMPSymbolProperties (AbstractConverter &converter, const pft::Variable &var) |
int64_t | getCollapseValue (const Fortran::parser::OmpClauseList &clauseList) |
void | genThreadprivateOp (AbstractConverter &, const pft::Variable &) |
void | genDeclareTargetIntGlobal (AbstractConverter &, const pft::Variable &) |
bool | isOpenMPTargetConstruct (const parser::OpenMPConstruct &) |
bool | isOpenMPDeviceDeclareTarget (Fortran::lower::AbstractConverter &, Fortran::semantics::SemanticsContext &, Fortran::lower::pft::Evaluation &, const parser::OpenMPDeclarativeConstruct &) |
void | gatherOpenMPDeferredDeclareTargets (Fortran::lower::AbstractConverter &, Fortran::semantics::SemanticsContext &, Fortran::lower::pft::Evaluation &, const parser::OpenMPDeclarativeConstruct &, llvm::SmallVectorImpl< OMPDeferredDeclareTargetInfo > &) |
bool | markOpenMPDeferredDeclareTargetFunctions (mlir::Operation *, llvm::SmallVectorImpl< OMPDeferredDeclareTargetInfo > &, AbstractConverter &) |
void | genOpenMPRequires (mlir::Operation *, const Fortran::semantics::Symbol *) |
std::unique_ptr< pft::Program > | createPFT (const parser::Program &root, const Fortran::semantics::SemanticsContext &semanticsContext) |
void | dumpPFT (llvm::raw_ostream &outputStream, const pft::Program &pft) |
Dumper for displaying a PFT. | |
bool | definedInCommonBlock (const semantics::Symbol &sym) |
bool | symbolIsGlobal (const semantics::Symbol &sym) |
Is the symbol sym a global? | |
bool | defaultRecursiveFunctionSetting () |
void | genNotifyWaitStatement (AbstractConverter &, const parser::NotifyWaitStmt &) |
void | genEventPostStatement (AbstractConverter &, const parser::EventPostStmt &) |
void | genEventWaitStatement (AbstractConverter &, const parser::EventWaitStmt &) |
void | genLockStatement (AbstractConverter &, const parser::LockStmt &) |
void | genFailImageStatement (AbstractConverter &) |
void | genStopStatement (AbstractConverter &, const parser::StopStmt &) |
void | genSyncAllStatement (AbstractConverter &, const parser::SyncAllStmt &) |
void | genSyncImagesStatement (AbstractConverter &, const parser::SyncImagesStmt &) |
void | genSyncMemoryStatement (AbstractConverter &, const parser::SyncMemoryStmt &) |
void | genSyncTeamStatement (AbstractConverter &, const parser::SyncTeamStmt &) |
void | genUnlockStatement (AbstractConverter &, const parser::UnlockStmt &) |
void | genPauseStatement (AbstractConverter &, const parser::PauseStmt &) |
void | genPointerAssociate (fir::FirOpBuilder &, mlir::Location, mlir::Value pointer, mlir::Value target) |
void | genPointerAssociateRemapping (fir::FirOpBuilder &, mlir::Location, mlir::Value pointer, mlir::Value target, mlir::Value bounds) |
void | genPointerAssociateLowerBounds (fir::FirOpBuilder &, mlir::Location, mlir::Value pointer, mlir::Value target, mlir::Value lbounds) |
void | genCleanUpInRegionIfAny (mlir::Location loc, fir::FirOpBuilder &builder, mlir::Region ®ion, StatementContext &context) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &os, const SymbolBox &symMap) |
llvm::raw_ostream & | operator<< (llvm::raw_ostream &os, const SymMap &symMap) |
VectorSubscriptBox | genVectorSubscriptBox (mlir::Location loc, Fortran::lower::AbstractConverter &converter, Fortran::lower::StatementContext &stmtCtx, const Fortran::evaluate::Expr< Fortran::evaluate::SomeType > &expr) |
Implements the conversion from evaluate::ProcedureRef to FIR.
Implements the conversion from evaluate::Constant to FIR.
using Fortran::lower::AggregateStoreKey = typedef std::tuple<const Fortran::semantics::Scope *, std::size_t> |
AggregateStoreMap is used to keep track of instantiated aggregate stores when lowering a scope containing equivalences (aliases). It must only be owned by the code lowering a scope and provided to instantiateVariable.
using Fortran::lower::LoweredResult = typedef std::variant<fir::ExtendedValue, hlfir::EntityWithAttributes> |
Data structure packaging the SSA value(s) produced for the result of lowered function calls.
using Fortran::lower::OperandGetter = typedef std::function<fir::ExtendedValue(std::size_t, bool)> |
Type of the callback to generate an argument reference after the call preparation was done. For optional arguments, the utility guarantees these callbacks will only be called in regions where the presence was verified. This means the getter callback can dereference the argument without any special care. For elemental intrinsics, the getter must provide the current iteration element value. If the boolean argument is true, the callback must load the argument before returning it.
using Fortran::lower::OperandPrepare = typedef std::function<void(const Fortran::lower::SomeExpr &)> |
Type of callback to be provided to prepare the arguments fetching from an actual argument expression.
using Fortran::lower::OperandPresent = typedef std::function<std::optional<mlir::Value>(std::size_t)> |
Type of the callback to inquire about an argument presence, once the call preparation was done. An absent optional means the argument is statically present. An mlir::Value means the presence must be checked at runtime, and that the value contains the "is present" boolean value.
using Fortran::lower::PreparedActualArguments = typedef llvm::SmallVector<std::optional<PreparedActualArgument> > |
Vector of pre-lowered actual arguments. nullopt if the actual is "statically" absent (if it was not syntactically provided).
mlir::Value Fortran::lower::argumentHostAssocs | ( | Fortran::lower::AbstractConverter & | converter, |
mlir::Value | arg | ||
) |
If arg
is the address of a function with a denoted host-association tuple argument, then return the host-associations tuple value of the current procedure. Otherwise, return nullptr.
void Fortran::lower::associateMutableBox | ( | AbstractConverter & | converter, |
mlir::Location | loc, | ||
const fir::MutableBoxValue & | box, | ||
const SomeExpr & | source, | ||
mlir::ValueRange | lbounds, | ||
StatementContext & | stmtCtx | ||
) |
Assign a boxed value to a boxed variable, box
(known as a MutableBoxValue). Expression source
will be lowered to build the assignment. If lbounds
is not empty, it is used to define the result's lower bounds. Otherwise, the lower bounds from source
will be used.
std::optional< hlfir::EntityWithAttributes > Fortran::lower::convertCallToHLFIR | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
const evaluate::ProcedureRef & | procRef, | ||
std::optional< mlir::Type > | resultType, | ||
Fortran::lower::SymMap & | symMap, | ||
Fortran::lower::StatementContext & | stmtCtx | ||
) |
Lower a ProcedureRef to HLFIR. If this is a function call, return the lowered result value. Return nothing otherwise.
fir::ExtendedValue Fortran::lower::convertExprToAddress | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
const Fortran::lower::SomeExpr & | expr, | ||
Fortran::lower::SymMap & | symMap, | ||
Fortran::lower::StatementContext & | stmtCtx | ||
) |
Lower an evaluate::Expr to fir::ExtendedValue address. The address may be a raw fir.ref<T>, or a fir.box<T>/fir.class<T>, or a fir.boxproc<>. Pointers and allocatable are dereferenced.
Beware that this is different from the previous createSomeExtendedAddress that had a non-trivial behaviour and would create contiguous temporary for array sections x(:, :)
, but not for x
even if x is not simply contiguous.
fir::ExtendedValue Fortran::lower::convertExprToBox | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
const Fortran::lower::SomeExpr & | expr, | ||
Fortran::lower::SymMap & | symMap, | ||
Fortran::lower::StatementContext & | stmtCtx | ||
) |
Lower an evaluate::Expr object to a fir.box, and a procedure designator to a fir.boxproc<>
fir::MutableBoxValue Fortran::lower::convertExprToMutableBox | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
const Fortran::lower::SomeExpr & | expr, | ||
Fortran::lower::SymMap & | symMap | ||
) |
Lower an evaluate::Expr to a fir::MutableBoxValue value. This can only be called if the Expr is a POINTER or ALLOCATABLE, otherwise, this will crash.
fir::ExtendedValue Fortran::lower::convertProcedureDesignator | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
const Fortran::evaluate::ProcedureDesignator & | proc, | ||
Fortran::lower::SymMap & | symMap, | ||
Fortran::lower::StatementContext & | stmtCtx | ||
) |
Lower a procedure designator to a fir::ExtendedValue that can be a fir::CharBoxValue for character procedure designator (the CharBoxValue length carries the result length if it is known).
hlfir::EntityWithAttributes Fortran::lower::convertProcedureDesignatorToHLFIR | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
const Fortran::evaluate::ProcedureDesignator & | proc, | ||
Fortran::lower::SymMap & | symMap, | ||
Fortran::lower::StatementContext & | stmtCtx | ||
) |
Lower a procedure designator to a !fir.boxproc<()->() or tuple<!fir.boxproc<()->(), len>.
hlfir::ElementalAddrOp Fortran::lower::convertVectorSubscriptedExprToElementalAddr | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
const Fortran::lower::SomeExpr & | designatorExpr, | ||
Fortran::lower::SymMap & | symMap, | ||
Fortran::lower::StatementContext & | stmtCtx | ||
) |
Lower a designator containing vector subscripts into an hlfir::ElementalAddrOp that will allow looping on the elements to assign them values. This only intends to cover the cases where such designator appears on the left-hand side of an assignment or appears in an input IO statement. These are the only contexts in Fortran where a vector subscripted entity may be modified. Otherwise, there is no need to do anything special about vector subscripts, they are automatically turned into array expression values via an hlfir.elemental in the convertExprToXXX calls.
void Fortran::lower::createAllocatableArrayAssignment | ( | AbstractConverter & | converter, |
const SomeExpr & | lhs, | ||
const SomeExpr & | rhs, | ||
ExplicitIterSpace & | explicitIterSpace, | ||
ImplicitIterSpace & | implicitIterSpace, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Lower an assignment to an allocatable array, allocating the array if it is not allocated yet or reallocation it if it does not conform with the right hand side.
void Fortran::lower::createAnyMaskedArrayAssignment | ( | AbstractConverter & | converter, |
const SomeExpr & | lhs, | ||
const SomeExpr & | rhs, | ||
ExplicitIterSpace & | explicitIterSpace, | ||
ImplicitIterSpace & | implicitIterSpace, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Common entry point for both explicit iteration spaces and implicit iteration spaces with masks.
For an implicit iteration space with masking, lowers an array assignment expression with masking expression(s).
For an explicit iteration space, lower a scalar or array assignment expression with a user-defined iteration space and possibly with masking expression(s).
If the expression is scalar, then the assignment is an array assignment but the array accesses are explicitly defined by the user and not implied for each element in the array. Mask expressions are optional.
If the expression has rank, then the assignment has a combined user-defined iteration space as well as a inner (subordinate) implied iteration space. The implied iteration space may include WHERE conditions, masks
.
void Fortran::lower::createArrayLoads | ( | AbstractConverter & | converter, |
ExplicitIterSpace & | esp, | ||
SymMap & | symMap | ||
) |
Create all the array_load ops for the explicit iteration space context. The nest of FORALLs must have been analyzed a priori.
void Fortran::lower::createArrayMergeStores | ( | AbstractConverter & | converter, |
ExplicitIterSpace & | esp | ||
) |
Create the array_merge_store ops after the explicit iteration space context is conmpleted.
void Fortran::lower::createArrayOfPointerAssignment | ( | AbstractConverter & | converter, |
const SomeExpr & | lhs, | ||
const SomeExpr & | rhs, | ||
ExplicitIterSpace & | explicitIterSpace, | ||
ImplicitIterSpace & | implicitIterSpace, | ||
const llvm::SmallVector< mlir::Value > & | lbounds, | ||
std::optional< llvm::SmallVector< mlir::Value > > | ubounds, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Lower a pointer assignment in an explicit iteration space. The explicit space iterates over a data structure with a type of !fir.array<... !fir.box<!fir.ptr<T>> ...>
. Lower the assignment by copying the rhs box value to each array element.
fir::ExtendedValue Fortran::lower::createBoxValue | ( | mlir::Location | loc, |
AbstractConverter & | converter, | ||
const SomeExpr & | expr, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Create a fir::BoxValue describing the value of expr
. If expr
is a variable without vector subscripts, the fir::BoxValue described the variable storage. Otherwise, the created fir::BoxValue describes a temporary storage containing expr
evaluation, and clean-up for the temporary is added to the provided StatementContext stmtCtx
.
void Fortran::lower::createEmptyRegionBlocks | ( | fir::FirOpBuilder & | builder, |
std::list< Fortran::lower::pft::Evaluation > & | evaluationList | ||
) |
Create empty blocks for the current region. These blocks replace blocks parented to an enclosing region.
fir::ExtendedValue Fortran::lower::createInitializerAddress | ( | mlir::Location | loc, |
AbstractConverter & | converter, | ||
const SomeExpr & | expr, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Create an address in an initializer context. Must be a constant or a symbol to be resolved at link-time. Expressions that appear in initializers may not allocate temporaries, do not have a stack, etc.
void Fortran::lower::createLazyArrayTempValue | ( | AbstractConverter & | converter, |
const SomeExpr & | expr, | ||
mlir::Value | raggedHeader, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Somewhat similar to createSomeArrayTempValue, but the temporary buffer is allocated lazily (inside the loops instead of before the loops) to accomodate buffers with shapes that cannot be precomputed. In fact, the buffer need not even be hyperrectangular. The buffer may be created as an instance of a ragged array, which may be useful if an array's extents are functions of other loop indices. The ragged array structure is built with raggedHeader
being the root header variable. The header is a tuple of {rank, data-is-headers, [data]*, [extents]*}
, which is built recursively. The base header, raggedHeader
, must be initialized to zeros.
fir::MutableBoxValue Fortran::lower::createMutableBox | ( | AbstractConverter & | converter, |
mlir::Location | loc, | ||
const pft::Variable & | var, | ||
mlir::Value | boxAddr, | ||
mlir::ValueRange | nonDeferredParams, | ||
bool | alwaysUseBox, | ||
unsigned | allocator = kDefaultAllocator |
||
) |
Create a MutableBoxValue for an allocatable or pointer entity. If the variables is a local variable that is not a dummy, it will be initialized to unallocated/diassociated status.
fir::MutableBoxValue Fortran::lower::createMutableBox | ( | mlir::Location | loc, |
AbstractConverter & | converter, | ||
const SomeExpr & | expr, | ||
SymMap & | symMap | ||
) |
Create the address of the box. expr
must be the designator of an allocatable/pointer entity.
mlir::acc::FirstprivateRecipeOp Fortran::lower::createOrGetFirstprivateRecipe | ( | mlir::OpBuilder & | builder, |
llvm::StringRef | recipeName, | ||
mlir::Location | loc, | ||
mlir::Type | ty, | ||
llvm::SmallVector< mlir::Value > & | bounds | ||
) |
Get a acc.firstprivate.recipe op for the given type or create it if it does not exist yet.
mlir::acc::PrivateRecipeOp Fortran::lower::createOrGetPrivateRecipe | ( | mlir::OpBuilder & | builder, |
llvm::StringRef | recipeName, | ||
mlir::Location | loc, | ||
mlir::Type | ty | ||
) |
Get a acc.private.recipe op for the given type or create it if it does not exist yet.
mlir::acc::ReductionRecipeOp Fortran::lower::createOrGetReductionRecipe | ( | fir::FirOpBuilder & | builder, |
llvm::StringRef | recipeName, | ||
mlir::Location | loc, | ||
mlir::Type | ty, | ||
mlir::acc::ReductionOperator | op, | ||
llvm::SmallVector< mlir::Value > & | bounds | ||
) |
Get a acc.reduction.recipe op for the given type or create it if it does not exist yet.
std::unique_ptr< lower::pft::Program > Fortran::lower::createPFT | ( | const parser::Program & | root, |
const Fortran::semantics::SemanticsContext & | semanticsContext | ||
) |
Create a PFT (Pre-FIR Tree) from the parse tree.
A PFT is a light weight tree over the parse tree that is used to create FIR. The PFT captures pointers back into the parse tree, so the parse tree must not be changed between the construction of the PFT and its last use. The PFT captures a structured view of a program. A program is a list of units. A function like unit contains a list of evaluations. An evaluation is either a statement, or a construct with a nested list of evaluations.
void Fortran::lower::createRuntimeTypeInfoGlobal | ( | Fortran::lower::AbstractConverter & | converter, |
const Fortran::semantics::Symbol & | typeInfoSym | ||
) |
Create a global variable for a compiler generated object that describes a derived type for the runtime.
void Fortran::lower::createSomeArrayAssignment | ( | AbstractConverter & | converter, |
const fir::ExtendedValue & | lhs, | ||
const fir::ExtendedValue & | rhs, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Lower an array assignment expression with pre-evaluated left and right hand sides. This implements an array copy taking into account non-contiguity and potential overlaps.
void Fortran::lower::createSomeArrayAssignment | ( | AbstractConverter & | converter, |
const fir::ExtendedValue & | lhs, | ||
const SomeExpr & | rhs, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Lower an array assignment expression with a pre-evaluated left hand side.
void Fortran::lower::createSomeArrayAssignment | ( | AbstractConverter & | converter, |
const SomeExpr & | lhs, | ||
const SomeExpr & | rhs, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Lower an array assignment expression.
fir::ExtendedValue Fortran::lower::createSomeArrayBox | ( | AbstractConverter & | converter, |
const SomeExpr & | expr, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Lower an array expression to a value of type box. The expression must be a variable.
fir::ExtendedValue Fortran::lower::createSomeArrayTempValue | ( | AbstractConverter & | converter, |
const SomeExpr & | expr, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Lower an array expression with "parallel" semantics. Such a rhs expression is fully evaluated prior to being assigned back to a temporary array.
fir::ExtendedValue Fortran::lower::createSomeInitializerExpression | ( | mlir::Location | loc, |
AbstractConverter & | converter, | ||
const SomeExpr & | expr, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx | ||
) |
Create the IR for the expression expr
in an initialization context. Expressions that appear in initializers may not allocate temporaries, do not have a stack, etc.
mlir::Value Fortran::lower::createSubroutineCall | ( | AbstractConverter & | converter, |
const evaluate::ProcedureRef & | call, | ||
ExplicitIterSpace & | explicitIterSpace, | ||
ImplicitIterSpace & | implicitIterSpace, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx, | ||
bool | isUserDefAssignment | ||
) |
Lower a subroutine call. This handles both elemental and non elemental subroutines. isUserDefAssignment
must be set if this is called in the context of a user defined assignment. For subroutines with alternate returns, the returned value indicates which label the code should jump to. The returned value is null otherwise.
void Fortran::lower::defineCommonBlocks | ( | AbstractConverter & | , |
const std::vector< std::pair< semantics::SymbolRef, std::size_t > > & | commonBlocks | ||
) |
Create fir::GlobalOp for all common blocks, including their initial values if they have one. This should be called before lowering any scopes so that common block globals are available when a common appear in a scope.
void Fortran::lower::defineModuleVariable | ( | AbstractConverter & | converter, |
const pft::Variable & | var | ||
) |
Create a fir::GlobalOp given a module variable definition. This is intended to be used when lowering a module definition, not when lowering variables used from a module. For used variables instantiateVariable must directly be called.
mlir::Value Fortran::lower::derefPassProcPointerComponent | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
const Fortran::evaluate::ProcedureDesignator & | proc, | ||
mlir::Value | passedArg, | ||
Fortran::lower::SymMap & | symMap, | ||
Fortran::lower::StatementContext & | stmtCtx | ||
) |
Given the value of a "PASS" actual argument passedArg
and the evaluate::ProcedureDesignator for the call, address and dereference the argument's procedure pointer component that must be called.
llvm::SmallVector< mlir::Value > Fortran::lower::genBaseBoundsOps | ( | fir::FirOpBuilder & | builder, |
mlir::Location | loc, | ||
fir::ExtendedValue | dataExv, | ||
bool | isAssumedSize | ||
) |
Generate bounds operation for base array without any subscripts provided.
llvm::SmallVector< mlir::Value > Fortran::lower::genBoundsOps | ( | fir::FirOpBuilder & | builder, |
mlir::Location | loc, | ||
Fortran::lower::AbstractConverter & | converter, | ||
Fortran::lower::StatementContext & | stmtCtx, | ||
const std::vector< Fortran::evaluate::Subscript > & | subscripts, | ||
std::stringstream & | asFortran, | ||
fir::ExtendedValue & | dataExv, | ||
bool | dataExvIsAssumedSize, | ||
AddrAndBoundsInfo & | info, | ||
bool | treatIndexAsSection = false |
||
) |
Generate bounds operations for an array section when subscripts are provided.
std::pair< Fortran::lower::LoweredResult, bool > Fortran::lower::genCallOpAndResult | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
Fortran::lower::SymMap & | symMap, | ||
Fortran::lower::StatementContext & | stmtCtx, | ||
Fortran::lower::CallerInterface & | caller, | ||
mlir::FunctionType | callSiteType, | ||
std::optional< mlir::Type > | resultType, | ||
bool | isElemental = false |
||
) |
Given a call site for which the arguments were already lowered, generate the call and return the result. This function deals with explicit result allocation and lowering if needed. It also deals with passing the host link to internal procedures. isElemental
must be set to true if elemental call is being produced. It is only used for HLFIR. The returned boolean indicates if finalization has been emitted in stmtCtx
for the result.
void Fortran::lower::genChangeTeamConstruct | ( | AbstractConverter & | converter, |
pft::Evaluation & | eval, | ||
const parser::ChangeTeamConstruct & | |||
) |
Implementation of the lowering of image related constructs and expressions. Fortran images can form teams, communicate via coarrays, etc.
void Fortran::lower::genCleanUpInRegionIfAny | ( | mlir::Location | loc, |
fir::FirOpBuilder & | builder, | ||
mlir::Region & | region, | ||
StatementContext & | context | ||
) |
If context
contains any cleanups, ensure region
has a block, and generate the cleanup inside that block.
mlir::Value Fortran::lower::genCommonBlockMember | ( | AbstractConverter & | converter, |
mlir::Location | loc, | ||
const Fortran::semantics::Symbol & | sym, | ||
mlir::Value | commonValue | ||
) |
The COMMON block is a global structure. commonValue
is the base address of the COMMON block. As the offset from the symbol sym
, generate the COMMON block member value (commonValue + offset) for the symbol.
void Fortran::lower::genDeclareSymbol | ( | Fortran::lower::AbstractConverter & | converter, |
Fortran::lower::SymMap & | symMap, | ||
const Fortran::semantics::Symbol & | sym, | ||
const fir::ExtendedValue & | exv, | ||
fir::FortranVariableFlagsEnum | extraFlags = fir::FortranVariableFlagsEnum::None , |
||
bool | force = false |
||
) |
Map a symbol to a given fir::ExtendedValue. This will generate an hlfir.declare when lowering to HLFIR and map the hlfir.declare result to the symbol.
Map a symbol to its FIR address and evaluated specification expressions provided as a fir::ExtendedValue. Will optionally create fir.declare.
mlir::Value Fortran::lower::genInitialDataTarget | ( | Fortran::lower::AbstractConverter & | converter, |
mlir::Location | loc, | ||
mlir::Type | boxType, | ||
const SomeExpr & | initialTarget, | ||
bool | couldBeInEquivalence = false |
||
) |
create initial-data-target fir.box in a global initializer region.
Create initial-data-target fir.box in a global initializer region. This handles the local instantiation of the target variable.
fir::ExtendedValue Fortran::lower::genInlinedStructureCtorLit | ( | Fortran::lower::AbstractConverter & | converter, |
mlir::Location | loc, | ||
const Fortran::evaluate::StructureConstructor & | ctor | ||
) |
Lower a StructureConstructor that must be lowered in read only data although it may not be wrapped into a Constant<T> (this may be the case for derived type descriptor compiler generated data that is not fully compliant with Fortran constant expression but can and must still be lowered into read only memory).
fir::ExtendedValue Fortran::lower::genIntrinsicCall | ( | fir::FirOpBuilder & | builder, |
mlir::Location | loc, | ||
llvm::StringRef | name, | ||
std::optional< mlir::Type > | resultType, | ||
llvm::ArrayRef< fir::ExtendedValue > | args, | ||
StatementContext & | stmtCtx, | ||
Fortran::lower::AbstractConverter * | converter = nullptr |
||
) |
DEPRECATED: NEW CODE SHOULD USE THE VERSION OF genIntrinsicCall WITHOUT A StatementContext, DECLARED IN IntrinsicCall.h Generate the FIR+MLIR operations for the generic intrinsic name
with argument args
and expected result type resultType
. Returned fir::ExtendedValue is the returned Fortran intrinsic value.
Generate the FIR+MLIR operations for the generic intrinsic name
with arguments args
and the expected result type resultType
. Returned fir::ExtendedValue is the returned Fortran intrinsic value.
void Fortran::lower::genOpenMPSymbolProperties | ( | lower::AbstractConverter & | converter, |
const pft::Variable & | var | ||
) |
Symbols in OpenMP code can have flags (e.g. threadprivate directive) that require additional handling when lowering the corresponding variable. Perform such handling according to the flags on the symbol. The variable var
is required to have a Symbol
.
Fortran::lower::VectorSubscriptBox Fortran::lower::genVectorSubscriptBox | ( | mlir::Location | loc, |
Fortran::lower::AbstractConverter & | converter, | ||
Fortran::lower::StatementContext & | stmtCtx, | ||
const Fortran::evaluate::Expr< Fortran::evaluate::SomeType > & | expr | ||
) |
Lower expr
, that must be an designator containing vector subscripts, to a VectorSubscriptBox representation. This causes evaluation of all the subscripts. Any required clean-ups from subscript expression are added to stmtCtx
.
mlir::Value Fortran::lower::getAssumedCharAllocatableOrPointerLen | ( | fir::FirOpBuilder & | builder, |
mlir::Location | loc, | ||
const Fortran::semantics::Symbol & | sym, | ||
mlir::Value | box | ||
) |
Read the length from box
for an assumed length character allocatable or pointer dummy argument given by sym
.
mlir::Type Fortran::lower::getCrayPointeeBoxType | ( | mlir::Type | fortranType | ) |
mlir::Type Fortran::lower::getDummyProcedureType | ( | const Fortran::semantics::Symbol & | dummyProc, |
Fortran::lower::AbstractConverter & | converter | ||
) |
Return the type of an argument that is a dummy procedure. This may be an mlir::FunctionType, but it can also be a more elaborate type based on the function type (like a tuple<function type, length type> for character functions).
mlir::func::FuncOp Fortran::lower::getOrDeclareFunction | ( | const Fortran::evaluate::ProcedureDesignator & | proc, |
Fortran::lower::AbstractConverter & | converter | ||
) |
Declare or find the mlir::func::FuncOp for the procedure designator proc
. If the mlir::func::FuncOp does not exist yet, declare it with the signature translated from the ProcedureDesignator argument. Due to Fortran implicit function typing rules, the returned FuncOp is not guaranteed to have the signature from ProcedureDesignator if the FuncOp was already declared.
void Fortran::lower::instantiateVariable | ( | AbstractConverter & | converter, |
const pft::Variable & | var, | ||
SymMap & | symMap, | ||
AggregateStoreMap & | storeMap | ||
) |
Instantiate variable var
and add it to symMap
. The AbstractConverter builder must be set. The AbstractConverter own symbol mapping is not used during the instantiation and can be different form symMap
.
bool Fortran::lower::intrinsicRequiresCustomOptionalHandling | ( | const Fortran::evaluate::ProcedureRef & | procRef, |
const Fortran::evaluate::SpecificIntrinsic & | intrinsic, | ||
AbstractConverter & | converter | ||
) |
Does the call procRef
to intrinsic
need to be handle via this custom framework due to optional arguments. Otherwise, the tools from IntrinsicCall.cpp should be used directly.
bool Fortran::lower::isCPtrArgByValueType | ( | mlir::Type | ty | ) |
Return true if ty
is "!fir.ref<i64>", which is the interface for type(C_PTR/C_FUNPTR) passed by value.
bool Fortran::lower::isIntrinsicModuleProcRef | ( | const Fortran::evaluate::ProcedureRef & | procRef | ) |
Is procRef
an intrinsic module procedure that should be lowered as intrinsic procedures (with Optimizer/Builder/IntrinsicCall.h)?
bool Fortran::lower::isRankedArrayAccess | ( | const Fortran::evaluate::ArrayRef & | x | ) |
Examine each subscript expression of x
and return true if and only if any of the subscripts is a vector or has a rank greater than 0.
fir::ExtendedValue Fortran::lower::lowerCustomIntrinsic | ( | fir::FirOpBuilder & | builder, |
mlir::Location | loc, | ||
llvm::StringRef | name, | ||
std::optional< mlir::Type > | retTy, | ||
const OperandPresent & | isPresentCheck, | ||
const OperandGetter & | getOperand, | ||
std::size_t | numOperands, | ||
Fortran::lower::StatementContext & | stmtCtx | ||
) |
Given a callback getOperand
to generate a reference to the i-th argument, and a callback isPresentCheck
to test if an argument is present, this function lowers the intrinsic calls to name
whose argument were previously prepared with prepareCustomIntrinsicArgument. The elemental aspects must be taken into account by the caller (i.e, the function should be called during the loop nest generation for elemental intrinsics. It will not generate any implicit loop nest on its own).
void Fortran::lower::mapCallInterfaceSymbolsForDummyArgument | ( | AbstractConverter & | converter, |
const Fortran::lower::CallerInterface & | caller, | ||
SymMap & | symMap, | ||
const Fortran::semantics::Symbol & | dummySymbol | ||
) |
Instantiate the variables that appear in the specification expressions of a dummy argument of a procedure call. The instantiated variables are added to symMap
.
void Fortran::lower::mapCallInterfaceSymbolsForResult | ( | AbstractConverter & | converter, |
const Fortran::lower::CallerInterface & | caller, | ||
SymMap & | symMap | ||
) |
Instantiate the variables that appear in the specification expressions of the result of a function call. The instantiated variables are added to symMap
.
void Fortran::lower::mapSymbolAttributes | ( | AbstractConverter & | converter, |
const pft::Variable & | var, | ||
SymMap & | symMap, | ||
StatementContext & | stmtCtx, | ||
mlir::Value | preAlloc = {} |
||
) |
Lower a symbol attributes given an optional storage and
add it to the provided symbol map. If \preAlloc is not provided, a temporary storage will be allocated. This is a low level function that should only be used if instantiateVariable cannot be called.
Lower specification expressions and attributes of variable var
and add it to the symbol map. For a global or an alias, the address must be pre-computed and provided in preAlloc
. A dummy argument for the current entry point has already been mapped to an mlir block argument in mapDummiesAndResults. Its mapping may be updated here.
void Fortran::lower::prepareCustomIntrinsicArgument | ( | const Fortran::evaluate::ProcedureRef & | procRef, |
const Fortran::evaluate::SpecificIntrinsic & | intrinsic, | ||
std::optional< mlir::Type > | retTy, | ||
const OperandPrepare & | prepareOptionalArgument, | ||
const OperandPrepareAs & | prepareOtherArgument, | ||
AbstractConverter & | converter | ||
) |
Given a callback prepareOptionalArgument
to prepare optional arguments and a callback prepareOtherArgument
to prepare non-optional arguments prepare the intrinsic arguments calls. It is up to the caller to decide what argument preparation means, the only contract is that it should later allow the caller to provide callbacks to generate argument reference given an argument index without any further knowledge of the argument. The function simply visits the actual arguments, deciding which ones are dynamically optional, and calling the callbacks accordingly in argument order.
bool Fortran::lower::symbolSetsIntersect | ( | llvm::ArrayRef< FrontEndSymbol > | ctrlSet, |
const A & | exprSyms | ||
) |
Is there a Symbol in common between the concurrent header set and the set of symbols in the expression?
bool Fortran::lower::symbolsIntersectSubscripts | ( | llvm::ArrayRef< FrontEndSymbol > | ctrlSet, |
const A & | subscripts | ||
) |
Determine if the subscript expression symbols from an Ev::ArrayRef intersects with the set of concurrent control symbols, ctrlSet
.
fir::FortranVariableFlagsAttr Fortran::lower::translateSymbolAttributes | ( | mlir::MLIRContext * | mlirContext, |
const Fortran::semantics::Symbol & | sym, | ||
fir::FortranVariableFlagsEnum | extraFlags = fir::FortranVariableFlagsEnum::None |
||
) |
Translate the Fortran attributes of sym
into the FIR variable attribute representation.
cuf::DataAttributeAttr Fortran::lower::translateSymbolCUFDataAttribute | ( | mlir::MLIRContext * | mlirContext, |
const Fortran::semantics::Symbol & | sym | ||
) |
Translate the CUDA Fortran attributes of sym
into the FIR CUDA attribute representation.
fir::GlobalOp Fortran::lower::tryCreatingDenseGlobal | ( | fir::FirOpBuilder & | builder, |
mlir::Location | loc, | ||
mlir::Type | symTy, | ||
llvm::StringRef | globalName, | ||
mlir::StringAttr | linkage, | ||
bool | isConst, | ||
const Fortran::lower::SomeExpr & | initExpr, | ||
cuf::DataAttributeAttr | dataAttr = {} |
||
) |
Create a fir.global array with a dense attribute containing the value of initExpr
. Using a dense attribute allows faster MLIR compilation times compared to creating an initialization body for the initial value. However, a dense attribute can only be created if initExpr is a non-empty rank 1 numerical or logical Constant<T>. Otherwise, the value returned will be null.