Otawa
0.10
|
A set of values represented by a Circular Linear Progression. More...
#include <otawa/data/clp/ClpValue.h>
Public Member Functions | |
bool | isConst (void) const |
Value (kind_t kind=VAL, intn_t lower=0, intn_t delta=0, uintn_t mtimes=0) | |
Constructor for a new CLP. More... | |
Value (const Value &val) | |
Copy constructor. More... | |
Value (const int val) | |
Singleton constructor. More... | |
Value & | operator= (const Value &val) |
bool | isTop (void) const |
bool | operator== (const Value &val) const |
bool | operator!= (const Value &val) const |
Value | operator+ (const Value &val) const |
Value | operator- (const Value &val) const |
bool | operator>= (const int val) const |
kind_t | kind (void) const |
intn_t | lower (void) const |
intn_t | upper (void) const |
intn_t | delta (void) const |
uintn_t | mtimes (void) const |
intn_t | start (void) const |
intn_t | stop (void) const |
void | add (const Value &val) |
Add another set to the current one. More... | |
void | sub (const Value &val) |
Subtract anothe set to the current one. More... | |
void | print (io::Output &out) const |
Print a human representation of the CLP. More... | |
void | shl (const Value &val) |
Left shift the current value. More... | |
void | shr (const Value &val) |
Right shift the current value. More... | |
void | _or (const Value &val) |
Perform OR operator on values (modifying current one). More... | |
void | join (const Value &val) |
Join another set to the current one. More... | |
void | widening (const Value &val) |
Perform a widening to the infinite (to be filtred later) More... | |
void | ffwidening (const Value &val, int loopBound) |
Perform a widening, knowing flow facts for the loop. More... | |
void | inter (const Value &val) |
Intersection with the current value. More... | |
void | reverse (void) |
Reverse the CLP direction (swap upper and lower bounds, and use the opposite of delta as new delta). More... | |
bool | swrap (void) const |
bool | uwrap (void) const |
void | ge (intn_t k) |
Filter the current value with signed values greater than k. More... | |
void | geu (uintn_t k) |
Filter the current value with unsigned values greater than k. More... | |
void | le (intn_t k) |
Filter the current value with signed values lesser than k. More... | |
void | leu (uintn_t k) |
Filter the current value with unsigned values lesser than k. More... | |
void | eq (uintn_t k) |
void | ne (uintn_t k) |
void | _and (const Value &val) |
Perform AND on the current value. More... | |
void | set (kind_t kind, intn_t lower, intn_t delta, uintn_t mtimes) |
Set the values for the current object. More... | |
Static Public Attributes | |
static int | and_threshold = 8 |
Find a file of 1 in a word. More... | |
static const Value | none |
Represents the bottom element. More... | |
static const Value | all |
Represents the top element. More... | |
Private Member Functions | |
void | check (void) |
Private Attributes | |
kind_t | _kind |
intn_t | _lower |
intn_t | _delta |
uintn_t | _mtimes |
A set of values represented by a Circular Linear Progression.
Represents a CLP value.
Values are defined by a 3-tuple (lower, delta, mtimes) for 32bits numbers. A constant integer k is represented by (k, 0, 0) The Top element is represented by (0, 1, 2^32 - 1)
|
inline |
Constructor for a new CLP.
kind | the kind of the CLP |
lower | the lower bound |
delta | the delta |
mtimes | the number of time the delta is applied |
|
inline |
Copy constructor.
|
inline |
Singleton constructor.
val | the single integer element of the CLP |
void otawa::clp::Value::_and | ( | const Value & | val | ) |
void otawa::clp::Value::_or | ( | const Value & | val | ) |
Perform OR operator on values (modifying current one).
val | The value to OR with the current one. |
References _lower, otawa::clp::ALL, isConst(), kind(), and otawa::clp::NONE.
void otawa::clp::Value::add | ( | const Value & | val | ) |
Add another set to the current one.
val | the value to add |
References _delta, _kind, _lower, _mtimes, elm::abs(), otawa::clp::ALL, delta(), delta, otawa::clp::NONE, otawa::se::reverse(), set(), start(), otawa::clp::UMAXn, and otawa::clp::VAL.
Referenced by operator+().
|
inlineprivate |
|
inline |
Referenced by _and(), add(), otawa::se::SEConst::asString(), otawa::se::SEAddr::asString(), sub(), and widening().
void otawa::clp::Value::eq | ( | uintn_t | k | ) |
void otawa::clp::Value::ffwidening | ( | const Value & | val, |
int | loopBound | ||
) |
Perform a widening, knowing flow facts for the loop.
val | the value of the next iteration state |
loopBound | the maximum number of iteration of the loop |
References _delta, _kind, _lower, _mtimes, otawa::clp::ALL, isConst(), otawa::clp::NONE, set(), otawa::clp::UMAXn, and otawa::clp::VAL.
Referenced by otawa::clp::State::widening().
void otawa::clp::Value::ge | ( | intn_t | k | ) |
Filter the current value with signed values greater than k.
k | Threshold. |
References otawa::clp::MAXn, elm::none, and otawa::clp::VAL.
Referenced by otawa::se::applyFilter().
void otawa::clp::Value::geu | ( | uintn_t | k | ) |
Filter the current value with unsigned values greater than k.
k | Threshold. |
References elm::none, otawa::clp::UMAXn, and otawa::clp::VAL.
Referenced by otawa::se::applyFilter().
void otawa::clp::Value::inter | ( | const Value & | val | ) |
Intersection with the current value.
val | the value to do the intersection with |
References _delta, _lower, _mtimes, elm::abs(), delta, if(), isConst(), isTop(), otawa::clp::lcm(), lower(), elm::max(), elm::min(), otawa::clp::NONE, elm::roundup(), set(), start(), stop(), otawa::clp::umin(), and otawa::clp::VAL.
Referenced by otawa::se::applyFilter().
|
inline |
References delta.
Referenced by _and(), _or(), otawa::se::SEConst::asString(), otawa::se::SEAddr::asString(), otawa::se::SEReg::asString(), ffwidening(), otawa::clp::State::get(), otawa::se::getFilterForAddr(), otawa::se::getFilterForReg(), inter(), join(), otawa::se::FilterBuilder::makeFilters(), otawa::clp::State::set(), shl(), shr(), and widening().
|
inline |
References otawa::clp::ALL.
Referenced by inter(), and otawa::clp::Analysis::processWorkSpace().
void otawa::clp::Value::join | ( | const Value & | val | ) |
Join another set to the current one.
val | the value to be joined with |
References _delta, _kind, _lower, _mtimes, elm::abs(), otawa::clp::ALL, isConst(), elm::min(), otawa::clp::NONE, set(), start(), otawa::clp::umax(), otawa::clp::UMAXn, and otawa::clp::VAL.
Referenced by otawa::clp::State::join(), and otawa::dcache::CLPBlockBuilder::processBB().
|
inline |
void otawa::clp::Value::le | ( | intn_t | k | ) |
Filter the current value with signed values lesser than k.
k | Threshold. |
References otawa::clp::MAXn, otawa::clp::MINn, and elm::none.
Referenced by otawa::se::applyFilter().
void otawa::clp::Value::leu | ( | uintn_t | k | ) |
Filter the current value with unsigned values lesser than k.
k | Threshold. |
References elm::none, and otawa::clp::VAL.
Referenced by otawa::se::applyFilter().
|
inline |
|
inline |
Referenced by _and(), otawa::se::SEConst::asString(), and otawa::se::SEAddr::asString().
void otawa::clp::Value::ne | ( | uintn_t | k | ) |
|
inline |
References elm::operator==().
|
inline |
|
inline |
void otawa::clp::Value::print | ( | io::Output & | out | ) | const |
Print a human representation of the CLP.
out | the stream to output the representation |
References otawa::clp::ALL, elm::io::hex(), and otawa::clp::NONE.
Referenced by otawa::clp::operator<<().
void otawa::clp::Value::reverse | ( | void | ) |
Reverse the CLP direction (swap upper and lower bounds, and use the opposite of delta as new delta).
References set(), and otawa::clp::VAL.
void otawa::clp::Value::shl | ( | const Value & | val | ) |
Left shift the current value.
val | the value to shift the current one with. Must be a positive constant. |
References _lower, otawa::clp::ALL, isConst(), otawa::clp::NONE, set(), otawa::clp::UMAXn, and otawa::clp::VAL.
void otawa::clp::Value::shr | ( | const Value & | val | ) |
Right shift the current value.
val | the value to shift the current one with. Must be a positive constant. |
References _lower, otawa::clp::ALL, isConst(), otawa::clp::NONE, set(), otawa::clp::UMAXn, and otawa::clp::VAL.
|
inline |
Referenced by add(), otawa::se::applyFilter(), inter(), join(), and widening().
|
inline |
Referenced by otawa::se::applyFilter(), inter(), sub(), and widening().
void otawa::clp::Value::sub | ( | const Value & | val | ) |
Subtract anothe set to the current one.
Subtract another set to the current one.
val | the value to subtract |
References _delta, _kind, _lower, _mtimes, elm::abs(), otawa::clp::ALL, delta(), delta, otawa::clp::NONE, otawa::se::reverse(), set(), stop(), otawa::clp::UMAXn, and otawa::clp::VAL.
Referenced by operator-().
|
inline |
References elm::abs(), and otawa::clp::MAXn.
Referenced by otawa::se::applyFilter().
|
inline |
|
inline |
References elm::abs(), and otawa::clp::UMAXn.
Referenced by otawa::se::applyFilter().
void otawa::clp::Value::widening | ( | const Value & | val | ) |
Perform a widening to the infinite (to be filtred later)
val | the value of the next iteration state |
References _kind, _lower, elm::abs(), otawa::clp::ALL, delta(), isConst(), otawa::clp::NONE, set(), start(), stop(), and otawa::clp::UMAXn.
|
private |
Referenced by add(), ffwidening(), inter(), join(), operator=(), operator==(), and sub().
|
private |
Referenced by add(), ffwidening(), join(), operator=(), operator==(), sub(), and widening().
|
private |
Referenced by _or(), add(), ffwidening(), inter(), join(), operator=(), operator==(), shl(), shr(), sub(), and widening().
|
private |
Referenced by add(), ffwidening(), inter(), join(), operator=(), operator==(), and sub().
|
static |
Represents the top element.
Referenced by otawa::se::FilterBuilder::makeFilters(), and otawa::dcache::CLPBlockBuilder::processBB().
|
static |
Find a file of 1 in a word.
w | Word to process. |
n | Number of bits to one. |
|
static |
Represents the bottom element.
Referenced by otawa::dcache::CLPBlockBuilder::processBB().