PandA-2024.02
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
Range_Analysis.cpp File Reference
#include "Range_Analysis.hpp"
#include "config_HAVE_ASSERTS.hpp"
#include "Parameter.hpp"
#include "application_manager.hpp"
#include "basic_block.hpp"
#include "call_graph.hpp"
#include "call_graph_manager.hpp"
#include "function_behavior.hpp"
#include "graph.hpp"
#include "op_graph.hpp"
#include "var_pp_functor.hpp"
#include "design_flow_graph.hpp"
#include "design_flow_manager.hpp"
#include "function_frontend_flow_step.hpp"
#include "dead_code_elimination.hpp"
#include "hls_device.hpp"
#include "hls_manager.hpp"
#include "memory.hpp"
#include "custom_map.hpp"
#include <map>
#include <set>
#include <sstream>
#include <vector>
#include "ext_tree_node.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 "Bit_Value_opt.hpp"
#include "bit_lattice.hpp"
#include "dbgPrintHelper.hpp"
#include "string_manipulation.hpp"
#include <filesystem>
Include dependency graph for Range_Analysis.cpp:

Go to the source code of this file.

Data Structures

union  vcFloat
 
struct  vcFloat::_FP_STRUCT_LAYOUT
 
union  vcDouble
 
struct  vcDouble::_FP_STRUCT_LAYOUT
 
class  VarNode
 
class  ValueRange
 
class  SymbRange
 This is an interval that contains a symbolic limit, which is given by the bounds of a program name, e.g. More...
 
class  ConditionalValueRange
 
class  OpNode
 This class represents a generic operation in our analysis. More...
 
class  NodeContainer
 
class  PhiOpNode
 A constraint like sink = phi(src1, src2, ..., srcN) More...
 
class  UnaryOpNode
 A constraint like sink = operation(source) [l, u] Examples: unary instructions such as truncation, sign extensions, zero extensions. More...
 
class  SigmaOpNode
 Specific type of UnaryOp used to represent sigma functions. More...
 
class  BinaryOpNode
 A constraint like sink = source1 operation source2 intersect [l, u]. More...
 
class  TernaryOpNode
 
class  LoadOpNode
 
class  ControlDepNode
 Specific type of OpNode used in Nuutila's strongly connected components algorithm. More...
 
class  Nuutila
 
class  Meet
 

Macros

#define RA_JUMPSET
 . include More...
 
#define INTEGER_PTR
 
#define BITVALUE_UPDATE
 
#define RA_EXEC_NORMAL   0
 
#define RA_EXEC_READONLY   1
 
#define RA_EXEC_SKIP   2
 
#define CASE_MISCELLANEOUS
 
#define OPERATION_OPTION(opts, X)
 
#define RETURN_DISABLED_OPTION(x, bw)
 
#define RESULT_DISABLED_OPTION(x, var, stdResult)   enable_##x ? (stdResult) : getRangeFor(var, Regular)
 

Typedefs

using bw_t = Range::bw_t
 
using ConditionalValueRanges = std::map< tree_nodeConstRef, ConditionalValueRange, tree_reindexCompare >
 
using VarNodes = std::map< tree_nodeConstRef, VarNode *, tree_reindexCompare >
 
using OpNodes = CustomSet< OpNode * >
 
using DefMap = std::map< tree_nodeConstRef, OpNode *, tree_reindexCompare >
 
using UseMap = std::map< tree_nodeConstRef, CustomSet< OpNode * >, tree_reindexCompare >
 
using SymbMap = std::map< tree_nodeConstRef, CustomSet< OpNode * >, tree_reindexCompare >
 
using CallMap = CustomMap< unsigned int, std::list< tree_nodeConstRef > >
 
using ParmMap = CustomMap< unsigned int, std::pair< bool, std::vector< tree_nodeConstRef > >>
 

Enumerations

enum  updateType { ut_None = 0, ut_Range = 1, ut_BitValue = 2 }
 
enum  ValueRangeType { ValueRangeId, SymbRangeId }
 

Functions

std::ostream & operator<< (std::ostream &OS, const VarNode *VN)
 
 REF_FORWARD_DECL (ValueRange)
 
 CONSTREF_FORWARD_DECL (ValueRange)
 
template<class T >
T * GetVR (const ValueRange *t)
 
std::ostream & operator<< (std::ostream &OS, const ValueRange *BI)
 
template<typename T >
T * GetOp (OpNode *t)
 
template<typename T >
const T * GetOp (const OpNode *t)
 
unsigned int evaluateBranch (const tree_nodeRef br_op, const blocRef branchBB, int debug_level)
 
static RangeRef constructor_range (const tree_managerConstRef TM, const tree_nodeConstRef tn, const RangeConstRef init)
 

Variables

uint32_t sign
 
uint32_t exp
 
uint32_t frac
 
static bool enable_add = true
 
static bool enable_sub = true
 
static bool enable_mul = true
 
static bool enable_sdiv = true
 
static bool enable_udiv = true
 
static bool enable_srem = true
 
static bool enable_urem = true
 
static bool enable_shl = true
 
static bool enable_shr = true
 
static bool enable_abs = true
 
static bool enable_negate = true
 
static bool enable_not = true
 
static bool enable_and = true
 
static bool enable_or = true
 
static bool enable_xor = true
 
static bool enable_sext = true
 
static bool enable_zext = true
 
static bool enable_trunc = true
 
static bool enable_min = true
 
static bool enable_max = true
 
static bool enable_load = true
 
static bool enable_float_pack = true
 
static bool enable_view_convert = true
 
static bool enable_ternary
 
static bool enable_bit_phi = true
 

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 Range_Analysis.cpp.

Macro Definition Documentation

◆ BITVALUE_UPDATE

#define BITVALUE_UPDATE

Definition at line 100 of file Range_Analysis.cpp.

◆ CASE_MISCELLANEOUS

#define CASE_MISCELLANEOUS
Value:
aggr_init_expr_K: \
case case_label_expr_K: \
case lut_expr_K: \
case target_expr_K: \
case target_mem_ref_K: \
case target_mem_ref461_K: \
case binfo_K: \
case block_K: \
case constructor_K: \
case error_mark_K: \
case identifier_node_K: \
case ssa_name_K: \
case statement_list_K: \
case tree_list_K: \
case tree_vec_K: \
case call_expr_K

Definition at line 110 of file Range_Analysis.cpp.

Referenced by UnaryOpNode::eval(), BinaryOpNode::evaluate(), SymbRange::print(), and SymbRange::solveFuture().

◆ INTEGER_PTR

#define INTEGER_PTR

Definition at line 99 of file Range_Analysis.cpp.

◆ OPERATION_OPTION

#define OPERATION_OPTION (   opts,
 
)
Value:
if((opts).erase("no_" #X)) \
{ \
INDENT_DBG_MEX(DEBUG_LEVEL_VERY_PEDANTIC, debug_level, "Range analysis: " #X " operation disabled"); \
enable_##X = false; \
}
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.

Definition at line 2322 of file Range_Analysis.cpp.

◆ RA_EXEC_NORMAL

#define RA_EXEC_NORMAL   0

Definition at line 102 of file Range_Analysis.cpp.

◆ RA_EXEC_READONLY

#define RA_EXEC_READONLY   1

Definition at line 103 of file Range_Analysis.cpp.

◆ RA_EXEC_SKIP

#define RA_EXEC_SKIP   2

Definition at line 104 of file Range_Analysis.cpp.

◆ RA_JUMPSET

#define RA_JUMPSET

. include

behavior includes HLS include HLS/memory include stl Tree includes

Definition at line 97 of file Range_Analysis.cpp.

◆ RESULT_DISABLED_OPTION

#define RESULT_DISABLED_OPTION (   x,
  var,
  stdResult 
)    enable_##x ? (stdResult) : getRangeFor(var, Regular)

Definition at line 2333 of file Range_Analysis.cpp.

Referenced by UnaryOpNode::eval().

◆ RETURN_DISABLED_OPTION

#define RETURN_DISABLED_OPTION (   x,
  bw 
)
Value:
if(!enable_##x) \
{ \
return RangeRef(new Range(Regular, bw)); \
}
Definition: Range.hpp:63
x
Return the smallest n such that 2^n >= _x.

Definition at line 2328 of file Range_Analysis.cpp.

Referenced by BinaryOpNode::evaluate().

Typedef Documentation

◆ bw_t

using bw_t = Range::bw_t

Definition at line 128 of file Range_Analysis.cpp.

◆ CallMap

using CallMap = CustomMap<unsigned int, std::list<tree_nodeConstRef> >

Definition at line 4954 of file Range_Analysis.cpp.

◆ ConditionalValueRanges

Definition at line 2019 of file Range_Analysis.cpp.

◆ DefMap

Definition at line 2158 of file Range_Analysis.cpp.

◆ OpNodes

Definition at line 2156 of file Range_Analysis.cpp.

◆ ParmMap

using ParmMap = CustomMap<unsigned int, std::pair<bool, std::vector<tree_nodeConstRef> >>

Definition at line 4956 of file Range_Analysis.cpp.

◆ SymbMap

Definition at line 4269 of file Range_Analysis.cpp.

◆ UseMap

Definition at line 2160 of file Range_Analysis.cpp.

◆ VarNodes

Definition at line 2154 of file Range_Analysis.cpp.

Enumeration Type Documentation

◆ updateType

enum updateType
Enumerator
ut_None 
ut_Range 
ut_BitValue 

Definition at line 1177 of file Range_Analysis.cpp.

◆ ValueRangeType

Enumerator
ValueRangeId 
SymbRangeId 

Definition at line 1522 of file Range_Analysis.cpp.

Function Documentation

◆ CONSTREF_FORWARD_DECL()

CONSTREF_FORWARD_DECL ( ValueRange  )

◆ constructor_range()

static RangeRef constructor_range ( const tree_managerConstRef  TM,
const tree_nodeConstRef  tn,
const RangeConstRef  init 
)
static

Definition at line 3984 of file Range_Analysis.cpp.

References DEBUG_LEVEL_VERY_PEDANTIC, el, tree_helper::get_array_dim_and_bitsize(), GET_CONST_NODE, GET_INDEX_CONST_NODE, INDENT_DBG_MEX, tree_helper::IsArrayEquivType(), Regular, STR, THROW_ASSERT, and test_panda::type.

Referenced by LoadOpNode::opCtorGenerator().

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

◆ evaluateBranch()

unsigned int evaluateBranch ( const tree_nodeRef  br_op,
const blocRef  branchBB,
int  debug_level 
)

◆ GetOp() [1/2]

template<typename T >
T* GetOp ( OpNode t)
inline

Definition at line 2027 of file Range_Analysis.cpp.

◆ GetOp() [2/2]

template<typename T >
const T* GetOp ( const OpNode t)
inline

Definition at line 2032 of file Range_Analysis.cpp.

◆ GetVR()

template<class T >
T* GetVR ( const ValueRange t)
inline

Definition at line 1532 of file Range_Analysis.cpp.

◆ operator<<() [1/2]

std::ostream& operator<< ( std::ostream &  OS,
const VarNode VN 
)

Definition at line 1513 of file Range_Analysis.cpp.

References VarNode::print().

Here is the call graph for this function:

◆ operator<<() [2/2]

std::ostream& operator<< ( std::ostream &  OS,
const ValueRange BI 
)

Definition at line 1593 of file Range_Analysis.cpp.

References ValueRange::print().

Here is the call graph for this function:

◆ REF_FORWARD_DECL()

REF_FORWARD_DECL ( ValueRange  )

Variable Documentation

◆ enable_abs

bool enable_abs = true
static

Definition at line 2304 of file Range_Analysis.cpp.

◆ enable_add

bool enable_add = true
static

Definition at line 2295 of file Range_Analysis.cpp.

◆ enable_and

bool enable_and = true
static

Definition at line 2307 of file Range_Analysis.cpp.

◆ enable_bit_phi

bool enable_bit_phi = true
static

Definition at line 2320 of file Range_Analysis.cpp.

◆ enable_float_pack

bool enable_float_pack = true
static

Definition at line 2316 of file Range_Analysis.cpp.

◆ enable_load

bool enable_load = true
static

Definition at line 2315 of file Range_Analysis.cpp.

◆ enable_max

bool enable_max = true
static

Definition at line 2314 of file Range_Analysis.cpp.

◆ enable_min

bool enable_min = true
static

Definition at line 2313 of file Range_Analysis.cpp.

◆ enable_mul

bool enable_mul = true
static

Definition at line 2297 of file Range_Analysis.cpp.

◆ enable_negate

bool enable_negate = true
static

Definition at line 2305 of file Range_Analysis.cpp.

◆ enable_not

bool enable_not = true
static

Definition at line 2306 of file Range_Analysis.cpp.

◆ enable_or

bool enable_or = true
static

Definition at line 2308 of file Range_Analysis.cpp.

◆ enable_sdiv

bool enable_sdiv = true
static

Definition at line 2298 of file Range_Analysis.cpp.

◆ enable_sext

bool enable_sext = true
static

Definition at line 2310 of file Range_Analysis.cpp.

◆ enable_shl

bool enable_shl = true
static

Definition at line 2302 of file Range_Analysis.cpp.

◆ enable_shr

bool enable_shr = true
static

Definition at line 2303 of file Range_Analysis.cpp.

◆ enable_srem

bool enable_srem = true
static

Definition at line 2300 of file Range_Analysis.cpp.

◆ enable_sub

bool enable_sub = true
static

Definition at line 2296 of file Range_Analysis.cpp.

◆ enable_ternary

bool enable_ternary
static
Initial value:
=
false

Definition at line 2318 of file Range_Analysis.cpp.

◆ enable_trunc

bool enable_trunc = true
static

Definition at line 2312 of file Range_Analysis.cpp.

◆ enable_udiv

bool enable_udiv = true
static

Definition at line 2299 of file Range_Analysis.cpp.

◆ enable_urem

bool enable_urem = true
static

Definition at line 2301 of file Range_Analysis.cpp.

◆ enable_view_convert

bool enable_view_convert = true
static

Definition at line 2317 of file Range_Analysis.cpp.

◆ enable_xor

bool enable_xor = true
static

Definition at line 2309 of file Range_Analysis.cpp.

◆ enable_zext

bool enable_zext = true
static

Definition at line 2311 of file Range_Analysis.cpp.

◆ exp

uint64_t exp

◆ frac

uint64_t frac

Definition at line 136 of file Range_Analysis.cpp.

◆ sign

uint64_t sign

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