Lines Matching refs:reg_num

129 int LinearScan::reg_num(LIR_Opr opr) {
184 return i->reg_num() < LinearScan::nof_regs;
188 return i->reg_num() >= LIR_OprDesc::vreg_base;
192 return i->reg_num() < LinearScan::nof_cpu_regs;
197 return i->reg_num() >= LIR_OprDesc::vreg_base;
199 return i->reg_num() >= LIR_OprDesc::vreg_base && (i->type() != T_FLOAT && i->type() != T_DOUBLE);
204 return i->reg_num() >= LinearScan::nof_cpu_regs && i->reg_num() < LinearScan::nof_regs;
211 return i->reg_num() >= LIR_OprDesc::vreg_base && (i->type() == T_FLOAT || i->type() == T_DOUBLE);
217 return i->reg_num() >= nof_regs && pd_first_fpu_reg <= i->assigned_reg() && i->assigned_reg() <= pd_last_fpu_reg;
222 return i->reg_num() >= nof_regs && i->type() == T_OBJECT;
284 // create a new interval with a predefined reg_num
286 Interval* LinearScan::create_interval(int reg_num) {
287 assert(_intervals.at(reg_num) == NULL, "overwriting exisiting interval");
289 Interval* interval = new Interval(reg_num);
290 _intervals.at_put(reg_num, interval);
293 if (reg_num < LIR_OprDesc::vreg_base) {
294 interval->assign_reg(reg_num);
299 // assign a new reg_num to the interval and append it to the list of intervals
309 if (gen()->is_vreg_flag_set(from->reg_num(), LIRGenerator::byte_reg)) {
310 gen()->set_vreg_flag(to->reg_num(), LIRGenerator::byte_reg);
312 if (gen()->is_vreg_flag_set(from->reg_num(), LIRGenerator::callee_saved)) {
313 gen()->set_vreg_flag(to->reg_num(), LIRGenerator::callee_saved);
424 TRACE_LINEAR_SCAN(4, tty->print_cr("interval %d (from %d to %d) must be stored at %d", temp->reg_num(), temp->from(), temp->to(), temp->spill_definition_pos()));
477 TRACE_LINEAR_SCAN(4, tty->print_cr("inserting move after definition of interval %d to stack slot %d at op_id %d", interval->reg_num(), interval->canonical_spill_slot() - LinearScan::nof_regs, op_id));
559 assert(reg_num(opr) == opr->vreg_number() && !is_valid_reg_num(reg_numHi(opr)), "invalid optimization below");
623 assert(reg_num(opr) == opr->vreg_number() && !is_valid_reg_num(reg_numHi(opr)), "invalid optimization below");
641 reg = reg_num(opr);
670 assert(reg_num(opr) == opr->vreg_number() && !is_valid_reg_num(reg_numHi(opr)), "invalid optimization below");
684 reg = reg_num(opr);
686 live_kill.set_bit(reg_num(opr));
703 assert(reg_num(opr) == opr->vreg_number() && !is_valid_reg_num(reg_numHi(opr)), "invalid optimization below");
717 reg = reg_num(opr);
719 live_kill.set_bit(reg_num(opr));
887 assert(reg_num(opr) == opr->vreg_number() && !is_valid_reg_num(reg_numHi(opr)), "invalid optimization below");
898 assert(reg_num(opr) == opr->vreg_number() && !is_valid_reg_num(reg_numHi(opr)), "invalid optimization below");
902 int reg = reg_num(opr);
918 assert(reg_num(opr) == opr->vreg_number() && !is_valid_reg_num(reg_numHi(opr)), "invalid optimization below");
922 int reg = reg_num(opr);
938 assert(reg_num(opr) == opr->vreg_number() && !is_valid_reg_num(reg_numHi(opr)), "invalid optimization below");
942 int reg = reg_num(opr);
954 void LinearScan::add_def(int reg_num, int def_pos, IntervalUseKind use_kind, BasicType type) {
955 Interval* interval = interval_at(reg_num);
957 assert(interval->reg_num() == reg_num, "wrong interval");
975 TRACE_LINEAR_SCAN(2, tty->print_cr("Warning: def of reg %d at %d occurs without use", reg_num, def_pos));
981 interval = create_interval(reg_num);
988 TRACE_LINEAR_SCAN(2, tty->print_cr("Warning: dead value %d at %d in live intervals", reg_num, def_pos));
999 void LinearScan::add_use(int reg_num, int from, int to, IntervalUseKind use_kind, BasicType type) {
1000 Interval* interval = interval_at(reg_num);
1002 interval = create_interval(reg_num);
1004 assert(interval->reg_num() == reg_num, "wrong interval");
1014 void LinearScan::add_temp(int reg_num, int temp_pos, IntervalUseKind use_kind, BasicType type) {
1015 Interval* interval = interval_at(reg_num);
1017 interval = create_interval(reg_num);
1019 assert(interval->reg_num() == reg_num, "wrong interval");
1193 TRACE_LINEAR_SCAN(4, tty->print_cr("found move from stack slot %d to vreg %d", o->is_single_stack() ? o->single_stack_ix() : o->double_stack_ix(), reg_num(move->result_opr())));
1196 Interval* interval = interval_at(reg_num(move->result_opr()));
1238 Interval* from = interval_at(reg_num(move_from));
1239 Interval* to = interval_at(reg_num(move_to));
1242 TRACE_LINEAR_SCAN(4, tty->print_cr("operation at op_id %d: added hint from interval %d to %d", move->id(), from->reg_num(), to->reg_num()));
1255 Interval* from = interval_at(reg_num(move_from));
1256 Interval* to = interval_at(reg_num(move_to));
1259 TRACE_LINEAR_SCAN(4, tty->print_cr("operation at op_id %d: added hint from interval %d to %d", cmove->id(), from->reg_num(), to->reg_num()));
1287 caller_save_registers[num_caller_save_registers++] = reg_num(opr);
1301 caller_save_registers[num_caller_save_registers++] = reg_num(opr);
1310 caller_save_registers[num_caller_save_registers++] = reg_num(opr);
1674 Interval* LinearScan::interval_at_block_begin(BlockBegin* block, int reg_num) {
1675 assert(LinearScan::nof_regs <= reg_num && reg_num < num_virtual_regs(), "register number out of bounds");
1676 assert(interval_at(reg_num) != NULL, "no interval found");
1678 return split_child_at_op_id(interval_at(reg_num), block->first_lir_instruction_id(), LIR_OpVisitState::outputMode);
1681 Interval* LinearScan::interval_at_block_end(BlockBegin* block, int reg_num) {
1682 assert(LinearScan::nof_regs <= reg_num && reg_num < num_virtual_regs(), "register number out of bounds");
1683 assert(interval_at(reg_num) != NULL, "no interval found");
1685 return split_child_at_op_id(interval_at(reg_num), block->last_lir_instruction_id() + 1, LIR_OpVisitState::outputMode);
1688 Interval* LinearScan::interval_at_op_id(int reg_num, int op_id) {
1689 assert(LinearScan::nof_regs <= reg_num && reg_num < num_virtual_regs(), "register number out of bounds");
1690 assert(interval_at(reg_num) != NULL, "no interval found");
1692 return split_child_at_op_id(interval_at(reg_num), op_id, LIR_OpVisitState::inputMode);
1821 void LinearScan::resolve_exception_entry(BlockBegin* block, int reg_num, MoveResolver &move_resolver) {
1822 if (interval_at(reg_num) == NULL) {
1827 Interval* interval = interval_at_block_begin(block, reg_num);
1893 void LinearScan::resolve_exception_edge(XHandler* handler, int throwing_op_id, int reg_num, Phi* phi, MoveResolver &move_resolver) {
1894 if (interval_at(reg_num) == NULL) {
1902 Interval* to_interval = interval_at_block_begin(to_block, reg_num);
1926 // no phi function, so use reg_num also for from_interval
1928 Interval* from_interval = interval_at_op_id(reg_num, throwing_op_id);
2393 assert(interval->reg_num() >= LIR_OprDesc::vreg_base, "fixed interval found");
2815 assert(!has_call(op_id) || opr->is_stack() || !is_caller_save(reg_num(opr)), "can not have caller-save register operands at calls");
3193 if (i1->reg_num() != i) {
3194 tty->print_cr("Interval %d is on position %d in list", i1->reg_num(), i); i1->print(); tty->cr();
3198 if (i1->reg_num() >= LIR_OprDesc::vreg_base && i1->type() == T_ILLEGAL) {
3199 tty->print_cr("Interval %d has no type assigned", i1->reg_num()); i1->print(); tty->cr();
3204 tty->print_cr("Interval %d has no register assigned", i1->reg_num()); i1->print(); tty->cr();
3209 tty->print_cr("Interval %d: low and high register equal", i1->reg_num()); i1->print(); tty->cr();
3219 tty->print_cr("Interval %d has no Range", i1->reg_num()); i1->print(); tty->cr();
3225 tty->print_cr("Interval %d has zero length range", i1->reg_num()); i1->print(); tty->cr();
3244 tty->print_cr("Intervals %d and %d overlap and have the same register assigned", i1->reg_num(), i2->reg_num());
3309 if (interval_at(reg_num(opr)) == interval) {
3339 Interval* interval = interval_at(reg_num(opr));
3395 Interval* interval_at(int reg_num) const { return _allocator->interval_at(reg_num); }
3396 int reg_num(LIR_Opr opr) const { return _allocator->reg_num(opr); }
3441 Interval* interval = interval_at(reg_num(opr));
3475 tty->print(" %4d", input_state->at(i)->reg_num());
3557 TRACE_LINEAR_SCAN(4, tty->print_cr(" reg[%d] = %d", reg, interval->reg_num()));
3569 tty->print_cr("!! Error in register allocation: register %d does not contain interval %d", reg, interval->reg_num());
3592 if (opr->is_register() && LinearScan::is_processed_reg_num(reg_num(opr))) {
3593 Interval* interval = interval_at(reg_num(opr));
3613 state_put(input_state, reg_num(FrameMap::caller_save_cpu_reg_at(j)), NULL);
3616 state_put(input_state, reg_num(FrameMap::caller_save_fpu_reg_at(j)), NULL);
3621 state_put(input_state, reg_num(FrameMap::caller_save_xmm_reg_at(j)), NULL);
3637 if (opr->is_register() && LinearScan::is_processed_reg_num(reg_num(opr))) {
3638 Interval* interval = interval_at(reg_num(opr));
3652 if (opr->is_register() && LinearScan::is_processed_reg_num(reg_num(opr))) {
3653 Interval* interval = interval_at(reg_num(opr));
3835 assert(from_interval->reg_num() != to_interval->reg_num(), "from and to interval equal");
3840 LIR_Opr from_opr = LIR_OprFact::virtual_register(from_interval->reg_num(), from_interval->type());
3841 LIR_Opr to_opr = LIR_OprFact::virtual_register(to_interval->reg_num(), to_interval->type());
3851 TRACE_LINEAR_SCAN(4, tty->print_cr("MoveResolver: inserted move from register %d (%d, %d) to %d (%d, %d)", from_interval->reg_num(), from_interval->assigned_reg(), from_interval->assigned_regHi(), to_interval->reg_num(), to_interval->assigned_reg(), to_interval->assigned_regHi()));
3859 LIR_Opr to_opr = LIR_OprFact::virtual_register(to_interval->reg_num(), to_interval->type());
3862 TRACE_LINEAR_SCAN(4, tty->print("MoveResolver: inserted move from constant "); from_opr->print(); tty->print_cr(" to %d (%d, %d)", to_interval->reg_num(), to_interval->assigned_reg(), to_interval->assigned_regHi()));
3934 TRACE_LINEAR_SCAN(4, tty->print_cr("created new Interval %d for spilling", spill_interval->reg_num()));
3980 TRACE_LINEAR_SCAN(4, tty->print_cr("MoveResolver: adding mapping from %d (%d, %d) to %d (%d, %d)", from_interval->reg_num(), from_interval->assigned_reg(), from_interval->assigned_regHi(), to_interval->reg_num(), to_interval->assigned_reg(), to_interval->assigned_regHi()));
3989 TRACE_LINEAR_SCAN(4, tty->print("MoveResolver: adding mapping from "); from_opr->print(); tty->print_cr(" to %d (%d, %d)", to_interval->reg_num(), to_interval->assigned_reg(), to_interval->assigned_regHi()));
4069 Interval::Interval(int reg_num) :
4070 _reg_num(reg_num),
4120 assert(i1->reg_num() != i2->reg_num(), "same register number");
4197 tty->print_cr("two valid result intervals found for op_id %d: %d and %d", op_id, result->reg_num(), tmp->reg_num());
4312 if (use_kind != noUse && reg_num() >= LIR_OprDesc::vreg_base) {
4382 // Note: The new interval has no valid reg_num
4531 if (reg_num() < LIR_OprDesc::vreg_base) {
4553 out->print("%d %s ", reg_num(), type_name);
4559 out->print("%d %d ", split_parent()->reg_num(), (register_hint(false) != NULL ? register_hint(false)->reg_num() : -1));
5204 TRACE_LINEAR_SCAN(4, tty->print_cr(" kicking out interval %d out of its register because it is never used", parent->reg_num()));
5236 TRACE_LINEAR_SCAN(4, tty->print_cr(" inserting move from interval %d to %d", it->reg_num(), spilled_part->reg_num()));
5532 tty->print("%d ", _spill_intervals[i]->at(j)->reg_num());
5668 return in->is_virtual() && res->is_virtual() && in->vreg_number() == from->reg_num() && res->vreg_number() == to->reg_num();
5736 TRACE_LINEAR_SCAN(4, tty->print_cr(" split_parent: %d, insert_move_when_activated: %d", cur->split_parent()->reg_num(), cur->insert_move_when_activated()));
5746 } else if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::must_start_in_memory)) {
5781 assert(cur->current_split_child()->reg_num() != cur->reg_num(), "cannot insert move between same interval");
5782 TRACE_LINEAR_SCAN(4, tty->print_cr("Inserting move from interval %d to %d because insert_move_when_activated is set", cur->current_split_child()->reg_num(), cur->reg_num()));