PandA-2024.02
Data Structures | Typedefs | Enumerations | Functions
eSSA.cpp File Reference
#include "eSSA.hpp"
#include "Dominance.hpp"
#include "OrderedInstructions.hpp"
#include "Parameter.hpp"
#include "Range.hpp"
#include "application_frontend_flow_step.hpp"
#include "application_manager.hpp"
#include "behavioral_helper.hpp"
#include "design_flow_manager.hpp"
#include "ext_tree_node.hpp"
#include "function_behavior.hpp"
#include "string_manipulation.hpp"
#include "token_interface.hpp"
#include "tree_basic_block.hpp"
#include "tree_helper.hpp"
#include "tree_manager.hpp"
#include "tree_manipulation.hpp"
#include "tree_reindex.hpp"
Include dependency graph for eSSA.cpp:

Go to the source code of this file.

Data Structures

class  Operand
 
class  PredicateBase
 
class  PredicateWithEdge
 
struct  ValueInfo
 
struct  DFSInfo
 
struct  ValueDFS
 
struct  ValueDFS_Compare
 

Typedefs

using ValueDFSStack = std::vector< ValueDFS >
 

Enumerations

enum  LocalNum { LN_First, LN_Middle, LN_Last }
 

Functions

unsigned int getBranchBlock (const PredicateBase *PB)
 
const ValueInfogetValueInfo (tree_nodeConstRef Operand, eSSA::ValueInfoLookup &ValueInfoNums, std::vector< ValueInfo > &ValueInfos)
 
ValueInfogetOrCreateValueInfo (tree_nodeConstRef Operand, eSSA::ValueInfoLookup &ValueInfoNums, std::vector< ValueInfo > &ValueInfos)
 
void addInfoFor (OperandRef Op, PredicateBase *PB, CustomSet< OperandRef > &OpsToRename, eSSA::ValueInfoLookup &ValueInfoNums, std::vector< ValueInfo > &ValueInfos)
 
bool isCompare (const struct binary_expr *condition)
 
tree_nodeRef branchOpRecurse (tree_nodeRef op, tree_nodeRef stmt=nullptr)
 
void processBranch (tree_nodeConstRef bi, CustomSet< OperandRef > &OpsToRename, eSSA::ValueInfoLookup &ValueInfoNums, std::vector< ValueInfo > &ValueInfos, CustomSet< std::pair< unsigned int, unsigned int >> &EdgeUsesOnly, const std::map< unsigned int, blocRef > &BBs, int debug_level)
 
void processMultiWayIf (tree_nodeConstRef mwii, CustomSet< OperandRef > &OpsToRename, eSSA::ValueInfoLookup &ValueInfoNums, std::vector< ValueInfo > &ValueInfos, CustomSet< std::pair< unsigned int, unsigned int >> &EdgeUsesOnly, const std::map< unsigned int, blocRef > &BBs, int debug_level)
 
bool valueComesBefore (OrderedInstructions &OI, tree_nodeConstRef A, tree_nodeConstRef B)
 
const std::pair< unsigned int, unsigned int > getBlockEdge (const PredicateBase *PB)
 
bool stackIsInScope (const ValueDFSStack &Stack, const ValueDFS &VDUse, const OrderedInstructions &OI)
 
void popStackUntilDFSScope (ValueDFSStack &Stack, const ValueDFS &VD, const OrderedInstructions &OI)
 
void convertUsesToDFSOrdered (tree_nodeRef Op, std::vector< ValueDFS > &DFSOrderedSet, BBGraphRef DT, const CustomMap< unsigned int, DFSInfo > &DFSInfos, int debug_level)
 
tree_nodeRef materializeStack (ValueDFSStack &RenameStack, unsigned int function_id, statement_list *sl, tree_nodeRef OrigOp, CustomMap< tree_nodeConstRef, const PredicateBase *> &PredicateMap, const BBGraphRef DT, tree_managerRef TM, tree_manipulationRef tree_man, CustomMap< std::pair< unsigned int, unsigned int >, blocRef > &interBranchBBs, CustomMap< unsigned int, DFSInfo > &DFSInfos, int debug_level)
 

Detailed Description

Author
Michele Fiorito miche.nosp@m.le.f.nosp@m.iorit.nosp@m.o@po.nosp@m.limi..nosp@m.it $Revision$ $Date$ Last modified by $Author$

Definition in file eSSA.cpp.

Typedef Documentation

◆ ValueDFSStack

using ValueDFSStack = std::vector<ValueDFS>

Definition at line 645 of file eSSA.cpp.

Enumeration Type Documentation

◆ LocalNum

enum LocalNum
Enumerator
LN_First 
LN_Middle 
LN_Last 

Definition at line 514 of file eSSA.cpp.

Function Documentation

◆ addInfoFor()

void addInfoFor ( OperandRef  Op,
PredicateBase PB,
CustomSet< OperandRef > &  OpsToRename,
eSSA::ValueInfoLookup ValueInfoNums,
std::vector< ValueInfo > &  ValueInfos 
)

Definition at line 223 of file eSSA.cpp.

References getOrCreateValueInfo(), and ValueInfo::Infos.

Referenced by processBranch(), and processMultiWayIf().

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

◆ branchOpRecurse()

tree_nodeRef branchOpRecurse ( tree_nodeRef  op,
tree_nodeRef  stmt = nullptr 
)

Definition at line 238 of file eSSA.cpp.

References GET_CONST_NODE, THROW_ASSERT, THROW_UNREACHABLE, and ToString().

Referenced by TernaryOpNode::eval(), and processBranch().

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

◆ convertUsesToDFSOrdered()

void convertUsesToDFSOrdered ( tree_nodeRef  Op,
std::vector< ValueDFS > &  DFSOrderedSet,
BBGraphRef  DT,
const CustomMap< unsigned int, DFSInfo > &  DFSInfos,
int  debug_level 
)

Definition at line 700 of file eSSA.cpp.

References DEBUG_LEVEL_VERY_PEDANTIC, ValueDFS::DFSIn, ValueDFS::DFSOut, bloc::ENTRY_BLOCK_ID, GET_CONST_NODE, GET_INDEX_CONST_NODE, INDENT_DBG_MEX, LN_Last, LN_Middle, ValueDFS::LocalNum, Operand::Operand(), STR, THROW_ASSERT, U, and ValueDFS::U.

Referenced by eSSA::renameUses().

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

◆ getBlockEdge()

const std::pair<unsigned int, unsigned int> getBlockEdge ( const PredicateBase PB)

Definition at line 501 of file eSSA.cpp.

References PredicateWithEdge::classof(), and THROW_ASSERT.

Referenced by ValueDFS_Compare::getBlockEdge_local(), eSSA::renameUses(), and stackIsInScope().

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

◆ getBranchBlock()

unsigned int getBranchBlock ( const PredicateBase PB)

Definition at line 180 of file eSSA.cpp.

References PredicateWithEdge::classof(), and THROW_ASSERT.

Referenced by stackIsInScope().

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

◆ getOrCreateValueInfo()

ValueInfo& getOrCreateValueInfo ( tree_nodeConstRef  Operand,
eSSA::ValueInfoLookup ValueInfoNums,
std::vector< ValueInfo > &  ValueInfos 
)

Definition at line 207 of file eSSA.cpp.

References Operand::Operand(), and THROW_ASSERT.

Referenced by addInfoFor().

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

◆ getValueInfo()

const ValueInfo& getValueInfo ( tree_nodeConstRef  Operand,
eSSA::ValueInfoLookup ValueInfoNums,
std::vector< ValueInfo > &  ValueInfos 
)

Definition at line 197 of file eSSA.cpp.

References THROW_ASSERT.

Referenced by eSSA::renameUses().

Here is the caller graph for this function:

◆ isCompare()

bool isCompare ( const struct binary_expr condition)

Definition at line 231 of file eSSA.cpp.

References tree_node::get_kind().

Referenced by TernaryOpNode::eval(), processBranch(), and processMultiWayIf().

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

◆ materializeStack()

tree_nodeRef materializeStack ( ValueDFSStack RenameStack,
unsigned int  function_id,
statement_list sl,
tree_nodeRef  OrigOp,
CustomMap< tree_nodeConstRef, const PredicateBase *> &  PredicateMap,
const BBGraphRef  DT,
tree_managerRef  TM,
tree_manipulationRef  tree_man,
CustomMap< std::pair< unsigned int, unsigned int >, blocRef > &  interBranchBBs,
CustomMap< unsigned int, DFSInfo > &  DFSInfos,
int  debug_level 
)

Definition at line 790 of file eSSA.cpp.

References PredicateWithEdge::classof(), tree_manipulation::create_phi_node(), DEBUG_LEVEL_VERY_PEDANTIC, ValueDFS::Def, GET_CONST_NODE, GET_NODE, INDENT_DBG_MEX, statement_list::list_of_bloc, phi, ValueDFS::PInfo, STR, THROW_ASSERT, THROW_UNREACHABLE, and ToString().

Referenced by eSSA::renameUses().

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

◆ popStackUntilDFSScope()

void popStackUntilDFSScope ( ValueDFSStack Stack,
const ValueDFS VD,
const OrderedInstructions OI 
)

Definition at line 690 of file eSSA.cpp.

References stackIsInScope().

Referenced by eSSA::renameUses().

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

◆ processBranch()

void processBranch ( tree_nodeConstRef  bi,
CustomSet< OperandRef > &  OpsToRename,
eSSA::ValueInfoLookup ValueInfoNums,
std::vector< ValueInfo > &  ValueInfos,
CustomSet< std::pair< unsigned int, unsigned int >> &  EdgeUsesOnly,
const std::map< unsigned int, blocRef > &  BBs,
int  debug_level 
)

Definition at line 277 of file eSSA.cpp.

References addInfoFor(), branchOpRecurse(), DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, GET_NODE, INDENT_DBG_MEX, isCompare(), Operand::Operand(), STR, THROW_ASSERT, and ToString().

Referenced by eSSA::InternalExec().

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

◆ processMultiWayIf()

void processMultiWayIf ( tree_nodeConstRef  mwii,
CustomSet< OperandRef > &  OpsToRename,
eSSA::ValueInfoLookup ValueInfoNums,
std::vector< ValueInfo > &  ValueInfos,
CustomSet< std::pair< unsigned int, unsigned int >> &  EdgeUsesOnly,
const std::map< unsigned int, blocRef > &  BBs,
int  debug_level 
)

Definition at line 393 of file eSSA.cpp.

References addInfoFor(), DEBUG_LEVEL_VERY_PEDANTIC, GET_CONST_NODE, INDENT_DBG_MEX, isCompare(), Operand::Operand(), STR, THROW_ASSERT, and ToString().

Referenced by eSSA::InternalExec().

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

◆ stackIsInScope()

bool stackIsInScope ( const ValueDFSStack Stack,
const ValueDFS VDUse,
const OrderedInstructions OI 
)

Definition at line 647 of file eSSA.cpp.

References ValueDFS::DFSIn, ValueDFS::DFSOut, OrderedInstructions::dominates(), GET_CONST_NODE, GET_INDEX_CONST_NODE, getBlockEdge(), getBranchBlock(), and ValueDFS::U.

Referenced by popStackUntilDFSScope(), and eSSA::renameUses().

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

◆ valueComesBefore()

bool valueComesBefore ( OrderedInstructions OI,
tree_nodeConstRef  A,
tree_nodeConstRef  B 
)

Definition at line 493 of file eSSA.cpp.

References OrderedInstructions::dominates(), and GET_CONST_NODE.

Referenced by ValueDFS_Compare::localComesBefore(), and eSSA::renameUses().

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

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