25 #ifndef _JIT_COMPILER2_LIVETIMEINTERVAL
26 #define _JIT_COMPILER2_LIVETIMEINTERVAL
49 class LivetimeIntervalImpl;
51 class LivetimeAnalysisPass;
54 class MachineOperandDesc;
55 class StackSlotManager;
56 class ManagedStackSlot;
57 class BasicBlockSchedule;
58 class MachineInstructionSchedule;
71 assert(type == PseudoUse || type == PseudoDef ||
op);
74 bool is_def()
const {
return type == Def; }
76 bool is_use()
const {
return type == Use; }
82 bool is_pseudo()
const {
return is_pseudo_use() || is_pseudo_def(); }
102 : start(start), end(end) {}
178 bool has_next()
const;
180 const_iterator begin()
const;
181 const_iterator end()
const;
182 std::size_t
size()
const;
188 const_use_iterator use_begin()
const;
189 const_use_iterator use_end()
const;
190 std::size_t use_size()
const;
192 const_def_iterator def_begin()
const;
193 const_def_iterator def_end()
const;
194 std::size_t def_size()
const;
196 shared_ptr<LivetimeIntervalImpl>
pimpl;
265 std::size_t
size()
const {
return intervals.size(); }
266 bool empty()
const {
return intervals.empty(); }
272 std::size_t
use_size()
const {
return uses.size(); }
276 std::size_t
def_size()
const {
return defs.size(); }
288 pimpl->add_range(first, last);
291 pimpl->set_from(from, to);
294 return pimpl->get_State(pos);
297 return pimpl->get_State(pos);
300 return pimpl->is_use_at(pos);
303 return pimpl->is_def_at(pos);
307 return pimpl->begin();
313 return pimpl->size();
316 return pimpl->empty();
319 return pimpl->front();
322 return pimpl->back();
325 return pimpl->get_operand();
328 return pimpl->get_operand(pos);
331 return pimpl->get_init_operand();
334 pimpl->set_operand(op);
337 return pimpl->get_hint();
343 return pimpl->next_usedef_after(pos,end);
346 return pimpl->split_active(pos, current);
349 return pimpl->split_inactive(pos, MO);
352 return pimpl->split_phi_active(pos, MO);
355 return pimpl->get_next();
358 return pimpl->has_next();
363 return pimpl->use_begin();
366 return pimpl->use_end();
369 return pimpl->use_size();
373 return pimpl->def_begin();
376 return pimpl->def_end();
379 return pimpl->def_size();
398 return (lhs < rhs || rhs < lhs);
401 return !(lhs != rhs);
404 return lhs < rhs || lhs == rhs;
void add_range(UseDef first, UseDef last)
A range the range [first, last] to the interval.
LivetimeInterval::iterator iterator
MachineOperand * get_operand() const
UseListTy::iterator use_iterator
MIIterator get_iterator() const
Get instruction iterator.
UseListTy::const_iterator const_use_iterator
const_iterator begin() const
LivetimeInterval::const_iterator const_iterator
std::multiset< UseDef > DefListTy
MachineOperand * get_init_operand() const
LivetimeInterval split_inactive(UseDef pos, MachineOperand *MO)
Split interval at inactive pos.
DefListTy::iterator def_iterator
Custom new/delete handler mixin.
void set_from(UseDef from, UseDef to)
Set from. If no interval available add range from to.
IntervalListTy::iterator iterator
LivetimeInterval::State State
DefListTy::const_iterator const_def_iterator
alloc::list< LivetimeRange >::type IntervalListTy
UseDef(Type type, MIIterator it, MachineOperandDesc *op=NULL)
constructor
void set_hint(MachineOperand *op)
State get_State(MIIterator pos) const
std::multiset< UseDef > DefListTy
Descriptor of a MachineOperand.
bool is_pseudo_use() const
Is a pseudo use position.
LivetimeInterval split_active(MIIterator pos, UseDef *current=NULL)
Split interval at active pos.
const_use_iterator use_begin() const
JNIEnv jthread jobject jclass jlong size
const_def_iterator def_begin() const
void set_operand(MachineOperand *op)
LivetimeRange front() const
MachineBasicBlock * current
std::list< T, Allocator< T > > type
UseListTy::iterator use_iterator
std::size_t use_size() const
const_use_iterator use_begin() const
std::multiset< UseDef > UseListTy
TODO: doc me!
DefListTy::iterator def_iterator
UseDef next_usedef_after(UseDef pos, UseDef end) const
get next use def after pos (if not found return end)
const_iterator end() const
const_iterator begin() const
LivetimeRange back() const
LivetimeInterval split_phi_active(MIIterator pos, MachineOperand *MO)
Split a phi input operand.
void set_operand(MachineOperand *op)
Set the current store of the interval.
LivetimeRange front() const
MachineOperand * operand
store for the interval
MachineOperand * get_hint() const
std::multiset< UseDef > UseListTy
Simple stream class for formatted output.
OStream & operator<<(OStream &OS, const Conditional::CondID &cond)
bool is_pseudo_def() const
Is a pseudo def position.
bool operator!=(const UseDef &lhs, const UseDef &rhs)
const_def_iterator def_begin() const
bool is_use() const
Is a use position.
bool operator==(const UseDef &lhs, const UseDef &rhs)
MachineOperandDesc * get_operand() const
Get operand descriptor.
std::size_t use_size() const
LivetimeRange back() const
LivetimeInterval & operator=(const LivetimeInterval &other)
copy assignment operator
MIIterator it
Iterator pointing to the instruction.
MachineOperand * get_init_operand() const
Get the initial operand.
UseDef next_intersection(const LivetimeInterval &a, const LivetimeInterval &b, UseDef pos, UseDef end)
const_iterator end() const
LivetimeIntervalImpl(MachineOperand *op)
construtor
MachineOperand * hint
hint for the interval
IntervalListTy::const_iterator const_iterator
UseListTy::const_iterator const_use_iterator
std::size_t def_size() const
LivetimeInterval get_next() const
Operands that can be directly used by the machine (register, memory, stackslot)
const_def_iterator def_end() const
bool operator<(const Edge &lhs, const Edge &rhs)
const_use_iterator use_end() const
const_def_iterator def_end() const
MachineOperand * get_operand() const
Get the current store of the interval.
MachineOperandDesc * op
Operand.
bool is_use_at(MIIterator pos) const
Is use position.
LivetimeRange(const UseDef &start, const UseDef &end)
MachineOperand * get_hint() const
Get the hint for the interval.
const_use_iterator use_end() const
static java_object_t * next
LivetimeInterval::IntervalListTy IntervalListTy
void insert_usedef(const UseDef &usedef)
shared_ptr< LivetimeIntervalImpl > pimpl
bool is_def() const
Is a def position.
bool is_def_at(MIIterator pos) const
Is def position.
LivetimeInterval get_next() const
get next split interval
void set_hint(MachineOperand *op)
Set the hit for the interval.
std::size_t def_size() const
bool operator<=(const UseDef &lhs, const UseDef &rhs)
LivetimeInterval(MachineOperand *)
constructor
MachineOperand * init_operand
initial operand for the interval
bool is_pseudo() const
Is a pseudo use/def.
DefListTy::const_iterator const_def_iterator