25 #ifndef _JIT_COMPILER2_LIVETIMEINTERVAL
26 #define _JIT_COMPILER2_LIVETIMEINTERVAL
48 class LivetimeIntervalImpl;
50 class LivetimeAnalysisPass;
53 class MachineOperandDesc;
54 class StackSlotManager;
55 class ManagedStackSlot;
56 class BasicBlockSchedule;
57 class MachineInstructionSchedule;
70 assert(type == PseudoUse || type == PseudoDef ||
op);
73 bool is_def()
const {
return type == Def; }
75 bool is_use()
const {
return type == Use; }
81 bool is_pseudo()
const {
return is_pseudo_use() || is_pseudo_def(); }
101 : start(start), end(end) {}
177 bool has_next()
const;
179 const_iterator begin()
const;
180 const_iterator end()
const;
181 std::size_t
size()
const;
187 const_use_iterator use_begin()
const;
188 const_use_iterator use_end()
const;
189 std::size_t use_size()
const;
191 const_def_iterator def_begin()
const;
192 const_def_iterator def_end()
const;
193 std::size_t def_size()
const;
195 std::shared_ptr<LivetimeIntervalImpl>
pimpl;
264 std::size_t
size()
const {
return intervals.size(); }
265 bool empty()
const {
return intervals.empty(); }
271 std::size_t
use_size()
const {
return uses.size(); }
275 std::size_t
def_size()
const {
return defs.size(); }
287 pimpl->add_range(first, last);
290 pimpl->set_from(from, to);
293 return pimpl->get_State(pos);
296 return pimpl->get_State(pos);
299 return pimpl->is_use_at(pos);
302 return pimpl->is_def_at(pos);
306 return pimpl->begin();
312 return pimpl->size();
315 return pimpl->empty();
318 return pimpl->front();
321 return pimpl->back();
324 return pimpl->get_operand();
327 return pimpl->get_operand(pos);
330 return pimpl->get_init_operand();
333 pimpl->set_operand(op);
336 return pimpl->get_hint();
342 return pimpl->next_usedef_after(pos,end);
345 return pimpl->split_active(pos, current);
348 return pimpl->split_inactive(pos, MO);
351 return pimpl->split_phi_active(pos, MO);
354 return pimpl->get_next();
357 return pimpl->has_next();
362 return pimpl->use_begin();
365 return pimpl->use_end();
368 return pimpl->use_size();
372 return pimpl->def_begin();
375 return pimpl->def_end();
378 return pimpl->def_size();
397 return (lhs < rhs || rhs < lhs);
400 return !(lhs != rhs);
403 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
std::shared_ptr< LivetimeIntervalImpl > pimpl
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)
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