Lines Matching refs:definitions
504 if (instr->definitions.empty()) in pseudo_propagate_temp()
509 std::all_of(instr->definitions.begin(), instr->definitions.end(), in pseudo_propagate_temp()
518 std::none_of(instr->definitions.begin(), instr->definitions.end(), in pseudo_propagate_temp()
546 decrease -= instr->definitions.back().bytes(); in pseudo_propagate_temp()
547 instr->definitions.pop_back(); in pseudo_propagate_temp()
553 if (temp.regClass() == instr->definitions[0].regClass()) in pseudo_propagate_temp()
587 tmp->definitions.size())); in to_VOP3()
589 for (unsigned i = 0; i < instr->definitions.size(); i++) { in to_VOP3()
590 instr->definitions[i] = tmp->definitions[i]; in to_VOP3()
591 if (instr->definitions[i].isTemp()) { in to_VOP3()
592 ssa_info& info = ctx.info[instr->definitions[i].tempId()]; in to_VOP3()
614 for (unsigned i = 0; i < instr->definitions.size(); i++) { in to_SDWA()
615 ssa_info& info = ctx.info[instr->definitions[i].tempId()]; in to_SDWA()
730 if (prevent_overflow && !add_instr->definitions[0].isNUW()) in parse_base_offset()
887 for (Definition& def : instr->definitions) in apply_extract()
1193 bool soe = smem.operands.size() >= (!smem.definitions.empty() ? 3 : 4); in label_instruction()
1203 smem.opcode, Format::SMEM, smem.operands.size() + 1, smem.definitions.size()); in label_instruction()
1206 if (smem.definitions.empty()) in label_instruction()
1209 if (!smem.definitions.empty()) in label_instruction()
1210 new_instr->definitions[0] = smem.definitions[0]; in label_instruction()
1233 if (instr->definitions.empty()) { in label_instruction()
1248 ctx.info[instr->definitions[0].tempId()].set_canonicalized(); in label_instruction()
1252 ctx.info[instr->definitions[0].tempId()].set_vopc(instr.get()); in label_instruction()
1257 ctx.info[instr->definitions[0].tempId()].set_vop3p(instr.get()); in label_instruction()
1265 instr->operands[0].regClass() == instr->definitions[0].regClass(); in label_instruction()
1267 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp()); in label_instruction()
1290 Definition def = instr->definitions[0]; in label_instruction()
1299 instr->definitions[0] = def; in label_instruction()
1305 ctx.info[instr->definitions[0].tempId()].set_vec(instr.get()); in label_instruction()
1313 for (Definition def : instr->definitions) { in label_instruction()
1327 for (unsigned i = 0; i < instr->definitions.size(); in label_instruction()
1328 split_offset += instr->definitions[i++].bytes()) { in label_instruction()
1333 vec->operands[vec_index].bytes() != instr->definitions[i].bytes()) in label_instruction()
1338 ctx.info[instr->definitions[i].tempId()].set_constant(ctx.program->chip_class, in label_instruction()
1341 ctx.info[instr->definitions[i].tempId()].set_undefined(); in label_instruction()
1344 ctx.info[instr->definitions[i].tempId()].set_temp(vec_op.getTemp()); in label_instruction()
1352 const unsigned dst_offset = index * instr->definitions[0].bytes(); in label_instruction()
1363 } else if (offset != dst_offset || op.bytes() != instr->definitions[0].bytes()) { in label_instruction()
1371 uint32_t mask = u_bit_consecutive(0, instr->definitions[0].bytes() * 8u); in label_instruction()
1374 Operand::get_const(ctx.program->chip_class, val, instr->definitions[0].bytes()); in label_instruction()
1376 } else if (index == 0 && instr->operands[0].size() == instr->definitions[0].size()) { in label_instruction()
1377 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp()); in label_instruction()
1380 if (instr->operands[0].bytes() != instr->definitions[0].bytes()) in label_instruction()
1390 instr->operands[0].regClass() != instr->definitions[0].regClass()) { in label_instruction()
1399 instr->definitions[0] = old_copy->definitions[0]; in label_instruction()
1404 ctx.info[op.tempId()].temp.type() == instr->definitions[0].regClass().type()) in label_instruction()
1407 ctx.info[instr->definitions[0].tempId()].set_vec(instr.get()); in label_instruction()
1412 if (instr->definitions[0].isFixed()) { in label_instruction()
1417 ctx.info[instr->definitions[0].tempId()].set_constant( in label_instruction()
1420 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp()); in label_instruction()
1422 ctx.info[instr->definitions[0].tempId()].set_canonicalized(); in label_instruction()
1431 ctx.info[instr->definitions[0].tempId()].set_dpp(instr.get()); in label_instruction()
1436 ctx.info[instr->definitions[0].tempId()].set_constant(ctx.program->chip_class, 0u); in label_instruction()
1438 case aco_opcode::v_mul_f64: ctx.info[instr->definitions[0].tempId()].set_mul(instr.get()); break; in label_instruction()
1441 ctx.info[instr->definitions[0].tempId()].set_mul(instr.get()); in label_instruction()
1463 ctx.info[instr->definitions[0].tempId()].set_neg_abs(other); in label_instruction()
1465 ctx.info[instr->definitions[0].tempId()].set_abs(other); in label_instruction()
1467 ctx.info[instr->definitions[0].tempId()].set_neg(other); in label_instruction()
1469 ctx.info[instr->definitions[0].tempId()].set_fcanonicalize(other); in label_instruction()
1484 ctx.info[instr->definitions[0].tempId()].set_constant(ctx.program->chip_class, 0u); in label_instruction()
1496 ctx.info[instr->definitions[0].tempId()].set_usedef(instr.get()); in label_instruction()
1522 ctx.info[instr->definitions[0].tempId()].set_vcc(instr->operands[2].getTemp()); in label_instruction()
1525 ctx.info[instr->definitions[0].tempId()].set_b2f(instr->operands[2].getTemp()); in label_instruction()
1527 ctx.info[instr->definitions[0].tempId()].set_b2i(instr->operands[2].getTemp()); in label_instruction()
1535 ctx.info[instr->definitions[0].tempId()].set_temp( in label_instruction()
1543 all_same_temp = instr->definitions[0].regClass() == instr->operands[0].regClass(); in label_instruction()
1550 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp()); in label_instruction()
1558 ctx.info[instr->definitions[0].tempId()].set_undefined(); in label_instruction()
1568 ctx.info[instr->definitions[0].tempId()].set_add_sub(instr.get()); in label_instruction()
1573 ctx.info[instr->definitions[0].tempId()].set_uniform_bitwise(); in label_instruction()
1574 ctx.info[instr->definitions[1].tempId()].set_scc_invert( in label_instruction()
1577 ctx.info[instr->definitions[0].tempId()].set_uniform_bitwise(); in label_instruction()
1578 ctx.info[instr->definitions[1].tempId()].set_scc_invert( in label_instruction()
1579 ctx.info[instr->operands[0].tempId()].instr->definitions[1].getTemp()); in label_instruction()
1581 ctx.info[instr->definitions[0].tempId()].set_bitwise(instr.get()); in label_instruction()
1589 ctx.info[instr->definitions[1].tempId()].set_temp( in label_instruction()
1591 ctx.info[instr->definitions[0].tempId()].set_uniform_bool( in label_instruction()
1597 ctx.info[instr->definitions[1].tempId()].set_temp( in label_instruction()
1598 ctx.info[instr->operands[0].tempId()].instr->definitions[1].getTemp()); in label_instruction()
1599 ctx.info[instr->definitions[0].tempId()].set_uniform_bool( in label_instruction()
1600 ctx.info[instr->operands[0].tempId()].instr->definitions[1].getTemp()); in label_instruction()
1607 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp()); in label_instruction()
1615 ctx.info[instr->definitions[0].tempId()].set_temp( in label_instruction()
1616 vopc_instr->definitions[0].getTemp()); in label_instruction()
1632 ctx.info[instr->definitions[0].tempId()].set_uniform_bitwise(); in label_instruction()
1641 ctx.info[instr->definitions[0].tempId()].set_bitwise(instr.get()); in label_instruction()
1655 ctx.info[instr->definitions[0].tempId()].set_minmax(instr.get()); in label_instruction()
1661 ctx.info[instr->definitions[0].tempId()].set_uniform_bool(instr->operands[2].getTemp()); in label_instruction()
1671 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp()); in label_instruction()
1678 ctx.info[instr->definitions[0].tempId()].set_canonicalized(); in label_instruction()
1681 if (instr->definitions[0].bytes() == 4) { in label_instruction()
1682 ctx.info[instr->definitions[0].tempId()].set_extract(instr.get()); in label_instruction()
1693 ctx.info[instr->definitions[0].tempId()].set_extract(instr.get()); in label_instruction()
1694 ctx.info[instr->definitions[0].tempId()].set_bitwise(instr.get()); in label_instruction()
1702 ctx.info[instr->definitions[0].tempId()].set_usedef(instr.get()); in label_instruction()
1710 if (!(ctx.info[instr->definitions[0].tempId()].label & (label_neg | label_abs))) in label_instruction()
1726 if (!--ctx.uses[instr->definitions[0].tempId()]) { in decrease_uses()
1744 if (instr->definitions.size() == 2) { in follow_operand()
1745 assert(instr->definitions[0].isTemp() && instr->definitions[0].tempId() == op.tempId()); in follow_operand()
1746 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()]) in follow_operand()
1758 if (instr->definitions[0].regClass() != ctx.program->lane_mask) in combine_ordering_test()
1760 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()]) in combine_ordering_test()
1837 instr->definitions[0].setHint(vcc); in combine_ordering_test()
1841 new_instr->definitions[0] = instr->definitions[0]; in combine_ordering_test()
1843 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_ordering_test()
1844 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr); in combine_ordering_test()
1856 if (instr->definitions[0].regClass() != ctx.program->lane_mask) in combine_comparison_ordering()
1858 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()]) in combine_comparison_ordering()
1912 instr->definitions[0].setHint(vcc); in combine_comparison_ordering()
1916 new_instr->definitions[0] = instr->definitions[0]; in combine_comparison_ordering()
1918 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_comparison_ordering()
1919 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr); in combine_comparison_ordering()
1958 if (instr->definitions[0].regClass() != ctx.program->lane_mask) in combine_constant_comparison_ordering()
1960 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()]) in combine_constant_comparison_ordering()
2038 instr->definitions[0].setHint(vcc); in combine_constant_comparison_ordering()
2042 new_instr->definitions[0] = instr->definitions[0]; in combine_constant_comparison_ordering()
2044 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_constant_comparison_ordering()
2045 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr); in combine_constant_comparison_ordering()
2058 if (ctx.uses[instr->definitions[1].tempId()]) in combine_inverse_comparison()
2112 instr->definitions[0].setHint(vcc); in combine_inverse_comparison()
2116 new_instr->definitions[0] = instr->definitions[0]; in combine_inverse_comparison()
2118 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_inverse_comparison()
2119 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr); in combine_inverse_comparison()
2175 *precise = op1_instr->definitions[0].isPrecise() || op2_instr->definitions[0].isPrecise(); in match_op3_for_vop3()
2217 new_instr->definitions[0] = instr->definitions[0]; in create_vop3_for_op3()
2218 ctx.info[instr->definitions[0].tempId()].label = 0; in create_vop3_for_op3()
2353 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()]) in combine_salu_not_bitwise()
2370 std::swap(instr->definitions[0], op2_instr->definitions[0]); in combine_salu_not_bitwise()
2371 std::swap(instr->definitions[1], op2_instr->definitions[1]); in combine_salu_not_bitwise()
2373 ctx.info[op2_instr->definitions[0].tempId()].label = 0; in combine_salu_not_bitwise()
2395 if (instr->definitions[0].isTemp() && ctx.info[instr->definitions[0].tempId()].is_uniform_bool()) in combine_salu_n2()
2403 if (ctx.uses[op2_instr->definitions[1].tempId()] || fixed_to_exec(op2_instr->operands[0])) in combine_salu_n2()
2413 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_salu_n2()
2432 if (instr->opcode == aco_opcode::s_add_i32 && ctx.uses[instr->definitions[1].tempId()]) in combine_salu_lshl_add()
2438 ctx.uses[op2_instr->definitions[1].tempId()]) in combine_salu_lshl_add()
2454 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_salu_lshl_add()
2489 new_instr->definitions[0] = instr->definitions[0]; in combine_add_sub_b2i()
2490 if (instr->definitions.size() == 2) { in combine_add_sub_b2i()
2491 new_instr->definitions[1] = instr->definitions[1]; in combine_add_sub_b2i()
2493 new_instr->definitions[1] = in combine_add_sub_b2i()
2500 new_instr->definitions[1].setHint(vcc); in combine_add_sub_b2i()
2505 ctx.info[instr->definitions[0].tempId()].set_add_sub(instr.get()); in combine_add_sub_b2i()
2530 new_instr->definitions[0] = instr->definitions[0]; in combine_add_bcnt()
2532 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_add_bcnt()
2817 if (instr->definitions.empty() || ctx.uses[instr->definitions[0].tempId()] != 1 || in apply_omod_clamp()
2827 if (instr->definitions[0].bytes() == 4) in apply_omod_clamp()
2834 ssa_info& def_info = ctx.info[instr->definitions[0].tempId()]; in apply_omod_clamp()
2841 if (!ctx.uses[def_info.instr->definitions[0].tempId()]) in apply_omod_clamp()
2845 assert(!ctx.info[instr->definitions[0].tempId()].is_mad()); in apply_omod_clamp()
2856 instr->definitions[0].swapTemp(def_info.instr->definitions[0]); in apply_omod_clamp()
2857 ctx.info[instr->definitions[0].tempId()].label &= label_clamp | label_insert; in apply_omod_clamp()
2858 ctx.uses[def_info.instr->definitions[0].tempId()]--; in apply_omod_clamp()
2869 if (instr->definitions.empty() || ctx.uses[instr->definitions[0].tempId()] != 1) in apply_insert()
2872 ssa_info& def_info = ctx.info[instr->definitions[0].tempId()]; in apply_insert()
2877 if (!ctx.uses[def_info.instr->definitions[0].tempId()]) in apply_insert()
2881 assert(!ctx.info[instr->definitions[0].tempId()].is_mad()); in apply_insert()
2902 instr->definitions[0].swapTemp(def_info.instr->definitions[0]); in apply_insert()
2903 ctx.info[instr->definitions[0].tempId()].label = 0; in apply_insert()
2904 ctx.uses[def_info.instr->definitions[0].tempId()]--; in apply_insert()
2928 unsigned dst_bitsize = extract->definitions[0].bytes() * 8u; in apply_ds_extract()
2954 std::swap(ds->definitions[0], extract->definitions[0]); in apply_ds_extract()
2955 ctx.uses[extract->definitions[0].tempId()] = 0; in apply_ds_extract()
2956 ctx.info[ds->definitions[0].tempId()].label = 0; in apply_ds_extract()
2993 new_instr->definitions[0] = instr->definitions[0]; in combine_and_subbrev()
2995 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_and_subbrev()
3059 new_instr->definitions[0] = instr->definitions[0]; in combine_add_lshl()
3061 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_add_lshl()
3106 instr->definitions[0].swapTemp(candidate->definitions[0]); in combine_vop3p()
3107 ctx.info[candidate->definitions[0].tempId()].instr = candidate; in combine_vop3p()
3108 ctx.uses[instr->definitions[0].tempId()]--; in combine_vop3p()
3147 if (--ctx.uses[fneg->definitions[0].tempId()]) in combine_vop3p()
3155 if (fadd && instr->definitions[0].isPrecise()) in combine_vop3p()
3170 info.instr->definitions[0].isPrecise()) in combine_vop3p()
3197 ctx.uses[mul_instr->definitions[0].tempId()]--; in combine_vop3p()
3198 if (ctx.uses[mul_instr->definitions[0].tempId()]) { in combine_vop3p()
3227 fma->definitions[0] = instr->definitions[0]; in combine_vop3p()
3229 ctx.info[instr->definitions[0].tempId()].set_vop3p(instr.get()); in combine_vop3p()
3240 if (instr->definitions.empty() || is_dead(ctx.uses, instr.get())) in combine_instruction()
3279 if (ctx.info[instr->definitions[0].tempId()].is_vcc_hint()) { in combine_instruction()
3280 instr->definitions[0].setHint(vcc); in combine_instruction()
3300 if (ctx.info[instr->definitions[0].tempId()].is_neg() && in combine_instruction()
3302 Temp val = ctx.info[instr->definitions[0].tempId()].temp; in combine_instruction()
3317 ctx.uses[mul_instr->definitions[0].tempId()]--; in combine_instruction()
3318 Definition def = instr->definitions[0]; in combine_instruction()
3320 bool is_abs = ctx.info[instr->definitions[0].tempId()].is_abs(); in combine_instruction()
3325 instr->definitions[0] = def; in combine_instruction()
3338 ctx.info[instr->definitions[0].tempId()].set_mul(instr.get()); in combine_instruction()
3352 if (need_fma && instr->definitions[0].isPrecise()) in combine_instruction()
3366 if (need_fma && info.instr->definitions[0].isPrecise()) in combine_instruction()
3387 ctx.uses[mul_instr->definitions[0].tempId()]--; in combine_instruction()
3388 if (ctx.uses[mul_instr->definitions[0].tempId()]) { in combine_instruction()
3448 mad->definitions[0] = instr->definitions[0]; in combine_instruction()
3451 ctx.mad_infos.emplace_back(std::move(instr), mul_instr->definitions[0].tempId()); in combine_instruction()
3452 ctx.info[mad->definitions[0].tempId()].set_mad(mad.get(), ctx.mad_infos.size() - 1); in combine_instruction()
3471 new_instr->definitions[0] = instr->definitions[0]; in combine_instruction()
3473 ctx.info[instr->definitions[0].tempId()].label = 0; in combine_instruction()
3519 bool carry_out = ctx.uses[instr->definitions[1].tempId()] > 0; in combine_instruction()
3529 instr->opcode != aco_opcode::v_sub_u32 && ctx.uses[instr->definitions[1].tempId()] > 0; in combine_instruction()
3608 assert(pred_instr->definitions.size() >= 2); in to_uniform_bool_instr()
3609 assert(pred_instr->definitions[1].isFixed() && in to_uniform_bool_instr()
3610 pred_instr->definitions[1].physReg() == scc); in to_uniform_bool_instr()
3611 op.setTemp(pred_instr->definitions[1].getTemp()); in to_uniform_bool_instr()
3619 instr->definitions[0].setTemp(Temp(instr->definitions[0].tempId(), s1)); in to_uniform_bool_instr()
3640 for (unsigned i = 0, offset = 0; i < instr->definitions.size(); in select_instruction()
3641 offset += instr->definitions[i++].bytes()) { in select_instruction()
3642 if (ctx.uses[instr->definitions[i].tempId()]) { in select_instruction()
3662 if (off != instr->operands[0].bytes() && op.bytes() == instr->definitions[idx].bytes()) { in select_instruction()
3674 extract->definitions[0] = instr->definitions[idx]; in select_instruction()
3682 instr->operands[0].bytes() % instr->definitions[idx].bytes() == 0 && in select_instruction()
3683 split_offset % instr->definitions[idx].bytes() == 0) { in select_instruction()
3688 Operand::c32((uint32_t)split_offset / instr->definitions[idx].bytes()); in select_instruction()
3689 extract->definitions[0] = instr->definitions[idx]; in select_instruction()
3695 if (!instr->definitions.empty() && ctx.info[instr->definitions[0].tempId()].is_mad()) { in select_instruction()
3696 mad_info = &ctx.mad_infos[ctx.info[instr->definitions[0].tempId()].instr->pass_flags]; in select_instruction()
3776 ctx.info[instr->definitions[0].tempId()].is_scc_needed()) { in select_instruction()
3781 instr->definitions[0].setFixed(scc); in select_instruction()
3789 if (instr->definitions.size() && ctx.uses[instr->definitions[0].tempId()] == 0 && in select_instruction()
3790 ctx.info[instr->definitions[0].tempId()].is_uniform_bitwise()) { in select_instruction()
3793 if (transform_done && !ctx.info[instr->definitions[1].tempId()].is_scc_needed()) { in select_instruction()
3796 uint32_t def0_id = instr->definitions[0].getTemp().id(); in select_instruction()
3797 uint32_t def1_id = instr->definitions[1].getTemp().id(); in select_instruction()
3798 instr->definitions[0].setTemp(Temp(def1_id, s1)); in select_instruction()
3799 instr->definitions[1].setTemp(Temp(def0_id, s1)); in select_instruction()
3824 if (--ctx.uses[info.instr->definitions[0].tempId()]) in select_instruction()
3921 if (!instr->definitions.empty() && ctx.info[instr->definitions[0].tempId()].is_mad()) { in apply_literals()
3922 mad_info* info = &ctx.mad_infos[ctx.info[instr->definitions[0].tempId()].instr->pass_flags]; in apply_literals()
3947 new_mad->definitions[0] = instr->definitions[0]; in apply_literals()