GCC Middle and Back End API Reference
|
#include <ipa-cp.h>
Public Member Functions | |
bool | bottom_p () const |
bool | top_p () const |
bool | constant_p () const |
bool | set_to_bottom () |
bool | set_to_constant (widest_int, widest_int) |
bool | known_nonzero_p () const |
widest_int | get_value () const |
widest_int | get_mask () const |
bool | meet_with (ipcp_bits_lattice &other, unsigned, signop, enum tree_code, tree, bool) |
bool | meet_with (widest_int, widest_int, unsigned) |
void | print (FILE *) |
Private Types | |
enum | { IPA_BITS_UNDEFINED , IPA_BITS_CONSTANT , IPA_BITS_VARYING } |
Private Member Functions | |
bool | meet_with_1 (widest_int, widest_int, unsigned, bool) |
void | get_value_and_mask (tree, widest_int *, widest_int *) |
Private Attributes | |
enum ipcp_bits_lattice:: { ... } | m_lattice_val = IPA_BITS_UNDEFINED |
widest_int | m_value |
widest_int | m_mask |
Lattice of known bits, only capable of holding one value. Bitwise constant propagation propagates which bits of a value are constant. For eg: int f(int x) { return some_op (x); } int f1(int y) { if (cond) return f (y & 0xff); else return f (y & 0xf); } In the above case, the param 'x' will always have all the bits (except the bits in lsb) set to 0. Hence the mask of 'x' would be 0xff. The mask reflects that the bits in lsb are unknown. The actual propagated value is given by m_value & ~m_mask.
|
inline |
References IPA_BITS_VARYING, and m_lattice_val.
Referenced by meet_with(), meet_with(), print(), propagate_bits_across_jump_function(), and set_to_bottom().
|
inline |
References IPA_BITS_CONSTANT, and m_lattice_val.
Referenced by ipcp_store_vr_results(), known_nonzero_p(), and meet_with_1().
|
inline |
References m_mask.
Referenced by ipcp_store_vr_results(), meet_with(), and print().
|
inline |
References m_value.
Referenced by ipcp_store_vr_results(), meet_with(), and print().
|
private |
Convert operand to value, mask form.
References get_nonzero_bits(), wi::to_widest(), and TREE_CODE.
Referenced by meet_with().
bool ipcp_bits_lattice::known_nonzero_p | ( | ) | const |
Return true if any of the known bits are non-zero.
References wi::bit_and(), wi::bit_not(), constant_p(), m_mask, m_value, and wi::ne_p().
Referenced by propagate_bits_across_jump_function().
bool ipcp_bits_lattice::meet_with | ( | ipcp_bits_lattice & | other, |
unsigned | precision, | ||
signop | sgn, | ||
enum tree_code | code, | ||
tree | operand, | ||
bool | drop_all_ones ) |
Meet bits lattice with the result of bit_value_binop (other, operand) if code is binary operation or bit_value_unop (other) if code is unary op. In the case when code is nop_expr, no adjustment is required. If DROP_ALL_ONES, mask out any known bits with value one afterwards.
References bit_value_binop(), bit_value_unop(), bottom_p(), get_mask(), get_value(), get_value_and_mask(), meet_with_1(), set_to_bottom(), set_to_constant(), wi::sext(), tcc_binary, tcc_unary, top_p(), TREE_CODE_CLASS, TREE_TYPE, TYPE_PRECISION, and TYPE_SIGN.
Referenced by propagate_bits_across_jump_function().
bool ipcp_bits_lattice::meet_with | ( | widest_int | value, |
widest_int | mask, | ||
unsigned | precision ) |
Meet the bits lattice with operand described by <value, mask, sgn, precision.
References bottom_p(), meet_with_1(), set_to_bottom(), set_to_constant(), wi::sext(), and top_p().
|
private |
Meet operation, similar to ccp_lattice_meet, we xor values if this->value, value have different values at same bit positions, we want to drop that bit to varying. Return true if mask is changed. This function assumes that the lattice value is in CONSTANT state. If DROP_ALL_ONES, mask out any known bits with value one afterwards.
References constant_p(), gcc_assert, m_mask, m_value, set_to_bottom(), and wi::sext().
Referenced by meet_with(), and meet_with().
void ipcp_bits_lattice::print | ( | FILE * | f | ) |
References bottom_p(), get_mask(), get_value(), print_hex(), and top_p().
Referenced by print_all_lattices().
bool ipcp_bits_lattice::set_to_bottom | ( | ) |
Set lattice value to bottom, if it already isn't the case.
References bottom_p(), IPA_BITS_VARYING, m_lattice_val, m_mask, and m_value.
Referenced by initialize_node_lattices(), meet_with(), meet_with(), meet_with_1(), propagate_bits_across_jump_function(), and set_all_contains_variable().
bool ipcp_bits_lattice::set_to_constant | ( | widest_int | value, |
widest_int | mask ) |
Set to constant if it isn't already. Only meant to be called when switching state from TOP.
References wi::bit_and(), wi::bit_not(), gcc_assert, IPA_BITS_CONSTANT, m_lattice_val, m_mask, m_value, and top_p().
Referenced by meet_with(), and meet_with().
|
inline |
References IPA_BITS_UNDEFINED, and m_lattice_val.
Referenced by meet_with(), meet_with(), print(), and set_to_constant().
enum { ... } ipcp_bits_lattice::m_lattice_val |
Referenced by bottom_p(), constant_p(), set_to_bottom(), set_to_constant(), and top_p().
|
private |
Referenced by get_mask(), known_nonzero_p(), meet_with_1(), set_to_bottom(), and set_to_constant().
|
private |
Referenced by get_value(), known_nonzero_p(), meet_with_1(), set_to_bottom(), and set_to_constant().