PandA-2024.02
|
#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"
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 ValueInfo & | getValueInfo (tree_nodeConstRef Operand, eSSA::ValueInfoLookup &ValueInfoNums, std::vector< ValueInfo > &ValueInfos) |
ValueInfo & | getOrCreateValueInfo (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) |
Definition in file eSSA.cpp.
using ValueDFSStack = std::vector<ValueDFS> |
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().
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().
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().
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().
unsigned int getBranchBlock | ( | const PredicateBase * | PB | ) |
Definition at line 180 of file eSSA.cpp.
References PredicateWithEdge::classof(), and THROW_ASSERT.
Referenced by stackIsInScope().
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().
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().
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().
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().
void popStackUntilDFSScope | ( | ValueDFSStack & | Stack, |
const ValueDFS & | VD, | ||
const OrderedInstructions & | OI | ||
) |
Definition at line 690 of file eSSA.cpp.
References stackIsInScope().
Referenced by eSSA::renameUses().
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().
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().
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().
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().