FLANG
Fortran::lower::pft::Evaluation Struct Reference

#include <flang/Lower/PFTBuilder.h>

Inheritance diagram for Fortran::lower::pft::Evaluation:

Public Types

enum class  ControlFlow { Structured , StructuredWithUnstructuredInternals , Unstructured }

Public Member Functions

template<typename A>
 Evaluation (const A &a, const PftNode &parent, const parser::CharBlock &position, const std::optional< parser::Label > &label)
 General ctor.
template<typename A>
 Evaluation (const A &a, const PftNode &parent)
 Construct and Directive ctor.
constexpr bool isActionStmt () const
 Evaluation classification predicates.
constexpr bool isOtherStmt () const
constexpr bool isConstructStmt () const
constexpr bool isEndStmt () const
constexpr bool isConstruct () const
constexpr bool isDirective () const
constexpr bool isNopConstructStmt () const
constexpr bool isExecutableDirective () const
constexpr bool isOpenMPDirective () const
constexpr bool isIntermediateConstructStmt () const
LLVM_DUMP_METHOD void dump () const
Evaluation & nonNopSuccessor () const
bool hasNestedEvaluations () const
 Return true if this Evaluation has at least one nested evaluation.
EvaluationList & getNestedEvaluations ()
 Return nested evaluation list.
Evaluation & getFirstNestedEvaluation ()
Evaluation & getLastNestedEvaluation ()
FunctionLikeUnit * getOwningProcedure () const
 Return the FunctionLikeUnit containing this evaluation (or nullptr).
void markControlFlow (ControlFlow kind)
void markUnstructured ()
void weakenControlFlow (ControlFlow kind)
bool isUnstructured () const
bool hasUnstructuredInternals () const
bool lowerBodyAsWrappedRegion () const
bool lowerAsStructured () const
bool lowerAsUnstructured () const
bool forceAsUnstructured () const

Public Attributes

PftNode parent
parser::CharBlock position {}
std::optional< parser::Label > label {}
std::unique_ptr< EvaluationList > evaluationList
llvm::SmallVector< const parser::CompilerDirective *, 1 > dirs
Evaluation * parentConstruct {nullptr}
Evaluation * lexicalSuccessor {nullptr}
Evaluation * controlSuccessor {nullptr}
llvm::SmallVector< Evaluation *, 0 > extraControlSuccessors
Evaluation * constructExit {nullptr}
bool isNewBlock {false}
ControlFlow controlFlow {ControlFlow::Structured}
bool negateCondition {false}
bool activeConstruct {false}
bool skipNextLowering {false}
mlir::Block * block {nullptr}
int printIndex {0}

Detailed Description

Function-like units contain lists of evaluations. These can be simple statements or constructs, where a construct contains its own evaluations.

Member Enumeration Documentation

◆ ControlFlow

How this evaluation's control flow is lowered. Ordered by how much it constrains lowering so that classification can only strengthen; see markControlFlow.

Enumerator
Structured 

Lowered structurally.

StructuredWithUnstructuredInternals 

Lowered structurally, but the body holds unstructured control flow confined to it. Lowering folds that body – not the construct, and not the loop control – into a parent region, so the structured op's single-block region stays well formed.

For now, this only applies to DO constructs.

Unstructured 

Lowered as unstructured blocks.

Member Function Documentation

◆ isIntermediateConstructStmt()

bool Fortran::lower::pft::Evaluation::isIntermediateConstructStmt ( ) const
inlineconstexpr

Return the predicate: "This is a non-initial, non-terminal construct statement." For an IfConstruct, this is ElseIfStmt and ElseStmt.

◆ isUnstructured()

bool Fortran::lower::pft::Evaluation::isUnstructured ( ) const
inline

True only for fully unstructured control flow, which is lowered as raw CFG blocks.

◆ lowerBodyAsWrappedRegion()

bool Fortran::lower::pft::Evaluation::lowerBodyAsWrappedRegion ( ) const

True when this construct is lowered structurally, yet its body holds unstructured control flow that has to be folded into an scf.execute_region.

◆ markControlFlow()

void Fortran::lower::pft::Evaluation::markControlFlow ( ControlFlow kind)
inline

Strengthen the classification to kind; it never weakens. This is what makes the analysis order-independent: a construct marked Unstructured by any one child stays Unstructured whatever its siblings contribute.

◆ nonNopSuccessor()

Evaluation & Fortran::lower::pft::Evaluation::nonNopSuccessor ( ) const
inline

Return the first non-nop successor of an evaluation, possibly exiting from one or more enclosing constructs.

◆ weakenControlFlow()

void Fortran::lower::pft::Evaluation::weakenControlFlow ( ControlFlow kind)
inline

Lower the classification to kind. Only for an analysis that has proven a stronger classification unnecessary; every other caller wants markControlFlow, which never weakens.


The documentation for this struct was generated from the following files: