PandA-2024.02
Public Member Functions | Private Member Functions | Private Attributes
determine_memory_accesses Class Reference

#include <determine_memory_accesses.hpp>

Inheritance diagram for determine_memory_accesses:
Inheritance graph
[legend]
Collaboration diagram for determine_memory_accesses:
Collaboration graph
[legend]

Public Member Functions

 determine_memory_accesses (const ParameterConstRef parameters, const application_managerRef AppM, unsigned int _function_id, const DesignFlowManagerConstRef design_flow_manager)
 Constructor. More...
 
 ~determine_memory_accesses () override
 Destructor. More...
 
DesignFlowStep_Status InternalExec () override
 Determines the variables that require a memory access. More...
 
- Public Member Functions inherited from FunctionFrontendFlowStep
 FunctionFrontendFlowStep (const application_managerRef AppM, const unsigned int function_id, const FrontendFlowStepType frontend_flow_step_type, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
 Constructor. More...
 
 ~FunctionFrontendFlowStep () override
 Destructor. More...
 
void ComputeRelationships (DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override
 Compute the relationships of a step with other steps. More...
 
std::string GetSignature () const override
 Return the signature of this step. More...
 
std::string GetName () const override
 Return the name of this design step. More...
 
DesignFlowStep_Status Exec () final
 Execute the step. More...
 
bool HasToBeExecuted () const override
 Check if this step has actually to be executed. More...
 
unsigned int CGetBBVersion () const
 
unsigned int GetBitValueVersion () const
 
void PrintInitialIR () const override
 Dump the initial intermediate representation. More...
 
void PrintFinalIR () const override
 Dump the final intermediate representation. More...
 
- Public Member Functions inherited from FrontendFlowStep
 FrontendFlowStep (const application_managerRef AppM, const FrontendFlowStepType frontend_flow_step_type, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
 Constructor. More...
 
 ~FrontendFlowStep () override
 Destructor. More...
 
virtual std::string GetKindText () const
 Return the name of the type of this frontend flow step. More...
 
DesignFlowStepFactoryConstRef CGetDesignFlowStepFactory () const override
 Return the factory to create this type of steps. More...
 
void PrintTreeManager (const bool before) const
 Dump the tree manager. More...
 
- Public Member Functions inherited from DesignFlowStep
 DesignFlowStep (const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
 Constructor. More...
 
virtual ~DesignFlowStep ()
 Destructor. More...
 
virtual void Initialize ()
 Initialize the step (i.e., like a constructor, but executed just before exec. More...
 
DesignFlowStep_Status GetStatus () const
 Return the status of this design step. More...
 
virtual void WriteDot (std::ostream &out) const
 Write the label for a dot graph. More...
 
bool IsComposed () const
 Returns if this step is composed. More...
 
int CGetDebugLevel () const
 Return the debug level of the step. More...
 

Private Member Functions

void analyze_node (const tree_nodeConstRef &tn, bool left_p, bool dynamic_address, bool no_dynamic_address)
 Analyze the given node ID to determine which variables have to be referred in memory. More...
 
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > ComputeFrontendRelationships (const DesignFlowStep::RelationshipType relationship_type) const override
 Return the set of analyses in relationship with this design step. More...
 

Private Attributes

const BehavioralHelperConstRef behavioral_helper
 The behavioral helper. More...
 
const tree_managerConstRef TM
 The tree manager. More...
 
CustomUnorderedSet< unsigned int > already_visited_ae
 Already visited address expression (used to avoid infinite recursion) More...
 
CustomUnorderedSet< unsigned int > already_visited
 

Additional Inherited Members

- Public Types inherited from FrontendFlowStep
using FunctionRelationship = enum { ALL_FUNCTIONS, CALLED_FUNCTIONS, CALLING_FUNCTIONS, SAME_FUNCTION, WHOLE_APPLICATION }
 The different relationship type between function analysis. More...
 
- Public Types inherited from DesignFlowStep
enum  RelationshipType { DEPENDENCE_RELATIONSHIP, INVALIDATION_RELATIONSHIP, PRECEDENCE_RELATIONSHIP }
 The relationship type. More...
 
- Static Public Member Functions inherited from FunctionFrontendFlowStep
static const std::string ComputeSignature (const FrontendFlowStepType frontend_flow_step_type, const unsigned int function_id)
 Compute the signature of a function frontend flow step. More...
 
- Static Public Member Functions inherited from FrontendFlowStep
static void CreateSteps (const DesignFlowManagerConstRef design_flow_manager, const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship >> &frontend_relationships, const application_managerConstRef application_manager, DesignFlowStepSet &relationships)
 Create the relationship steps of a step with other steps starting from already specified dependencies between frontend flow steps. More...
 
static const std::string EnumToKindText (const FrontendFlowStepType frontend_flow_step_type)
 Given a frontend flow step type, return the name of the type. More...
 
- Protected Member Functions inherited from FunctionFrontendFlowStep
void WriteBBGraphDot (const std::string &filename) const
 Write the current version of statement list in dot format. More...
 
- Protected Attributes inherited from FunctionFrontendFlowStep
const FunctionBehaviorRef function_behavior
 The function behavior of the function to be analyzed. More...
 
const unsigned int function_id
 The index of the function to be analyzed. More...
 
unsigned int bb_version
 The version of the basic block intermediate representation on which this step has been applied. More...
 
unsigned int bitvalue_version
 The version of the bitvalue information on which this step has been applied. More...
 
- Protected Attributes inherited from FrontendFlowStep
const application_managerRef AppM
 The application manager. More...
 
const FrontendFlowStepType frontend_flow_step_type
 The type of this step. More...
 
unsigned int print_counter
 Print counter. More...
 
- Protected Attributes inherited from DesignFlowStep
bool composed
 True if this step represents a composition of design flow steps (e.g., a flow); must be set by specialized constructors. More...
 
const Wrefcount< const DesignFlowManagerdesign_flow_manager
 The design flow manager. More...
 
const ParameterConstRef parameters
 Set of input parameters. More...
 
int debug_level
 The debug level. More...
 
const int output_level
 The output level. More...
 

Detailed Description

Definition at line 62 of file determine_memory_accesses.hpp.

Constructor & Destructor Documentation

◆ determine_memory_accesses()

determine_memory_accesses::determine_memory_accesses ( const ParameterConstRef  _parameters,
const application_managerRef  _AppM,
unsigned int  _function_id,
const DesignFlowManagerConstRef  _design_flow_manager 
)

Constructor.

Header include.

Parameters
parametersis the set of input parameters
AppMis the application manager
function_idis the node id of the function analyzed.
design_flow_manageris the design flow manager

Behavior include Parameter include Tree include

Definition at line 71 of file determine_memory_accesses.cpp.

References DesignFlowStep::debug_level, DEBUG_LEVEL_NONE, GET_CLASS, DesignFlowStep::parameters, and ~determine_memory_accesses().

Here is the call graph for this function:

◆ ~determine_memory_accesses()

determine_memory_accesses::~determine_memory_accesses ( )
overridedefault

Destructor.

Referenced by determine_memory_accesses().

Here is the caller graph for this function:

Member Function Documentation

◆ analyze_node()

void determine_memory_accesses::analyze_node ( const tree_nodeConstRef tn,
bool  left_p,
bool  dynamic_address,
bool  no_dynamic_address 
)
private

Analyze the given node ID to determine which variables have to be referred in memory.

check for implicit memcpy calls

manage temporary addresses

manage temporary addresses

an address of a parm decl may be used in writing so it has to be copied

check if the actual parameter has been allocated in memory

if the formal parameter has not been allocated in memory then it has to be initialized

check if the formal parameter has been allocated in memory.

If the actual has not been allocated in memory then the formal parameter storage has to be initialized with the actual value with a MEMSTORE_STD

check if the actual parameter has been allocated in memory

if the formal parameter has not been allocated in memory then it has to be initialized

check if the formal parameter has been allocated in memory.

If the actual has not been allocated in memory then the formal parameter storage has to be initialized with the actual value with a MEMSTORE_STD

skip the &

check for unaligned accesses

Definition at line 203 of file determine_memory_accesses.cpp.

References already_visited, already_visited_ae, FrontendFlowStep::AppM, test_panda::arg, test_panda::args, behavioral_helper, BUILTIN_WAIT_CALL, C_EC, CASE_BINARY_EXPRESSION, CASE_CPP_NODES, CASE_DECL_NODES, CASE_FAKE_NODES, CASE_GIMPLE_NODES, CASE_PRAGMA_NODES, CASE_QUATERNARY_EXPRESSION, CASE_TERNARY_EXPRESSION, CASE_TYPE_NODES, CASE_UNARY_EXPRESSION, tree_helper::CGetType(), DesignFlowStep::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, el, FunctionFrontendFlowStep::function_behavior, GET_CONST_NODE, BehavioralHelper::get_function_name(), GET_INDEX_CONST_NODE, GET_INDEX_NODE, tree_node::get_kind(), GET_NODE, tree_helper::GetBaseVariable(), tree_helper::GetMangledFunctionName(), INDENT_DBG_MEX, INDENT_OUT_MEX, tree_node::index, tree_helper::IsPointerType(), tree_helper::IsVectorType(), tree_helper::IsVolatile(), NODE_NOT_YET_SUPPORTED_EC, DesignFlowStep::output_level, OUTPUT_LEVEL_VERBOSE, DesignFlowStep::parameters, PRINT_DBG_MEX, tree_helper::print_function_name(), BehavioralHelper::PrintVariable(), STR, THROW_ASSERT, THROW_ERROR, THROW_ERROR_CODE, THROW_UNREACHABLE, TM, and tree_node::ToString().

Referenced by InternalExec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeFrontendRelationships()

const CustomUnorderedSet< std::pair< FrontendFlowStepType, FrontendFlowStep::FunctionRelationship > > determine_memory_accesses::ComputeFrontendRelationships ( const DesignFlowStep::RelationshipType  relationship_type) const
overrideprivatevirtual

Return the set of analyses in relationship with this design step.

Parameters
relationship_typeis the type of relationship to be considered

Implements FrontendFlowStep.

Definition at line 84 of file determine_memory_accesses.cpp.

References CALLED_FUNCTIONS, DesignFlowStep::DEPENDENCE_RELATIONSHIP, DesignFlowStep::INVALIDATION_RELATIONSHIP, DesignFlowStep::parameters, DesignFlowStep::PRECEDENCE_RELATIONSHIP, SAME_FUNCTION, and THROW_UNREACHABLE.

◆ InternalExec()

DesignFlowStep_Status determine_memory_accesses::InternalExec ( )
overridevirtual

Determines the variables that require a memory access.

cleanup data structure

analyze formal parameters

mem clean up

Implements FunctionFrontendFlowStep.

Definition at line 127 of file determine_memory_accesses.cpp.

References already_visited, already_visited_ae, analyze_node(), FrontendFlowStep::AppM, BB_ENTRY, BB_EXIT, DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, DEBUG_LEVEL_VERY_PEDANTIC, FunctionFrontendFlowStep::function_behavior, FunctionFrontendFlowStep::function_id, GET_CONST_NODE, DesignFlowStep::parameters, phi, PRINT_DBG_MEX, sl, SUCCESS, THROW_ASSERT, TM, and UNCHANGED.

Here is the call graph for this function:

Field Documentation

◆ already_visited

CustomUnorderedSet<unsigned int> determine_memory_accesses::already_visited
private

Definition at line 73 of file determine_memory_accesses.hpp.

Referenced by analyze_node(), and InternalExec().

◆ already_visited_ae

CustomUnorderedSet<unsigned int> determine_memory_accesses::already_visited_ae
private

Already visited address expression (used to avoid infinite recursion)

Definition at line 72 of file determine_memory_accesses.hpp.

Referenced by analyze_node(), and InternalExec().

◆ behavioral_helper

const BehavioralHelperConstRef determine_memory_accesses::behavioral_helper
private

The behavioral helper.

Definition at line 66 of file determine_memory_accesses.hpp.

Referenced by analyze_node().

◆ TM

const tree_managerConstRef determine_memory_accesses::TM
private

The tree manager.

Definition at line 69 of file determine_memory_accesses.hpp.

Referenced by analyze_node(), and InternalExec().


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

Generated on Mon Feb 12 2024 13:03:50 for PandA-2024.02 by doxygen 1.8.13