Lines Matching refs:definitions
537 if (instr->definitions.empty())
542 std::all_of(instr->definitions.begin(), instr->definitions.end(),
551 std::none_of(instr->definitions.begin(), instr->definitions.end(),
580 decrease -= instr->definitions.back().bytes();
581 instr->definitions.pop_back();
587 if (temp.regClass() == instr->definitions[0].regClass())
621 tmp->definitions.size()));
623 for (unsigned i = 0; i < instr->definitions.size(); i++) {
624 instr->definitions[i] = tmp->definitions[i];
625 if (instr->definitions[i].isTemp()) {
626 ssa_info& info = ctx.info[instr->definitions[i].tempId()];
650 for (unsigned i = 0; i < instr->definitions.size(); i++) {
651 ssa_info& info = ctx.info[instr->definitions[i].tempId()];
783 if (prevent_overflow && !add_instr->definitions[0].isNUW())
816 bool soe = smem->operands.size() >= (!smem->definitions.empty() ? 3 : 4);
862 bool soe = smem.operands.size() >= (!smem.definitions.empty() ? 3 : 4);
871 smem.opcode, Format::SMEM, smem.operands.size() + 1, smem.definitions.size());
874 if (smem.definitions.empty())
877 if (!smem.definitions.empty())
878 new_instr->definitions[0] = smem.definitions[0];
1035 unsigned size = instr->definitions[0].bytes();
1040 assert(instr->operands[0].bytes() == 4 && instr->definitions[1].bytes() == 2);
1157 for (Definition& def : instr->definitions)
1530 if (instr->definitions.empty()) {
1545 ctx.info[instr->definitions[0].tempId()].set_canonicalized();
1549 ctx.info[instr->definitions[0].tempId()].set_vopc(instr.get());
1554 ctx.info[instr->definitions[0].tempId()].set_vop3p(instr.get());
1562 instr->operands[0].regClass() == instr->definitions[0].regClass();
1564 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1587 Definition def = instr->definitions[0];
1596 instr->definitions[0] = def;
1602 ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
1609 instr->operands[0].getTemp() == split->definitions[0].getTemp())
1610 ctx.info[instr->definitions[0].tempId()].set_temp(split->operands[0].getTemp());
1620 for (Definition def : instr->definitions) {
1627 if (instr->definitions.size() == 2 && instr->operands[0].isTemp() &&
1628 instr->definitions[0].bytes() == instr->definitions[1].bytes()) {
1629 ctx.info[instr->definitions[1].tempId()].set_split(instr.get());
1632 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1633 ctx.info[instr->definitions[1].tempId()].set_extract(instr.get());
1643 for (unsigned i = 0; i < instr->definitions.size();
1644 split_offset += instr->definitions[i++].bytes()) {
1649 vec->operands[vec_index].bytes() != instr->definitions[i].bytes())
1654 ctx.info[instr->definitions[i].tempId()].set_constant(ctx.program->gfx_level,
1657 ctx.info[instr->definitions[i].tempId()].set_undefined();
1660 ctx.info[instr->definitions[i].tempId()].set_temp(vec_op.getTemp());
1668 const unsigned dst_offset = index * instr->definitions[0].bytes();
1679 } else if (offset != dst_offset || op.bytes() != instr->definitions[0].bytes()) {
1687 uint32_t mask = u_bit_consecutive(0, instr->definitions[0].bytes() * 8u);
1690 Operand::get_const(ctx.program->gfx_level, val, instr->definitions[0].bytes());
1694 if (instr->operands[0].bytes() != instr->definitions[0].bytes()) {
1699 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1701 ctx.info[instr->definitions[0].tempId()].set_extract(instr.get());
1712 instr->operands[0].regClass() != instr->definitions[0].regClass()) {
1721 instr->definitions[0] = old_copy->definitions[0];
1726 ctx.info[op.tempId()].temp.type() == instr->definitions[0].regClass().type())
1729 ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
1734 if (instr->definitions[0].isFixed()) {
1739 ctx.info[instr->definitions[0].tempId()].set_constant(
1742 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1744 ctx.info[instr->definitions[0].tempId()].set_canonicalized();
1753 ctx.info[instr->definitions[0].tempId()].set_dpp16(instr.get());
1755 ctx.info[instr->definitions[0].tempId()].set_dpp8(instr.get());
1760 ctx.info[instr->definitions[0].tempId()].set_constant(ctx.program->gfx_level, 0u);
1762 case aco_opcode::v_mul_f64: ctx.info[instr->definitions[0].tempId()].set_mul(instr.get()); break;
1766 ctx.info[instr->definitions[0].tempId()].set_mul(instr.get());
1788 ctx.info[instr->definitions[0].tempId()].set_neg_abs(other);
1790 ctx.info[instr->definitions[0].tempId()].set_abs(other);
1792 ctx.info[instr->definitions[0].tempId()].set_neg(other);
1794 ctx.info[instr->definitions[0].tempId()].set_fcanonicalize(other);
1810 ctx.info[instr->definitions[0].tempId()].set_constant(ctx.program->gfx_level, 0u);
1822 ctx.info[instr->definitions[0].tempId()].set_usedef(instr.get());
1848 ctx.info[instr->definitions[0].tempId()].set_vcc(instr->operands[2].getTemp());
1851 ctx.info[instr->definitions[0].tempId()].set_b2f(instr->operands[2].getTemp());
1853 ctx.info[instr->definitions[0].tempId()].set_b2i(instr->operands[2].getTemp());
1860 ctx.info[instr->definitions[0].tempId()].set_temp(
1868 all_same_temp = instr->definitions[0].regClass() == instr->operands[0].regClass();
1875 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1883 ctx.info[instr->definitions[0].tempId()].set_undefined();
1902 ctx.info[instr->definitions[0].tempId()].set_add_sub(instr.get());
1907 ctx.info[instr->definitions[0].tempId()].set_uniform_bitwise();
1908 ctx.info[instr->definitions[1].tempId()].set_scc_invert(
1911 ctx.info[instr->definitions[0].tempId()].set_uniform_bitwise();
1912 ctx.info[instr->definitions[1].tempId()].set_scc_invert(
1913 ctx.info[instr->operands[0].tempId()].instr->definitions[1].getTemp());
1915 ctx.info[instr->definitions[0].tempId()].set_bitwise(instr.get());
1923 ctx.info[instr->definitions[1].tempId()].set_temp(
1925 ctx.info[instr->definitions[0].tempId()].set_uniform_bool(
1931 ctx.info[instr->definitions[1].tempId()].set_temp(
1932 ctx.info[instr->operands[0].tempId()].instr->definitions[1].getTemp());
1933 ctx.info[instr->definitions[0].tempId()].set_uniform_bool(
1934 ctx.info[instr->operands[0].tempId()].instr->definitions[1].getTemp());
1941 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1944 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1959 ctx.info[instr->definitions[0].tempId()].set_uniform_bitwise();
1961 ctx.info[instr->definitions[0].tempId()].set_bitwise(instr.get());
1969 ctx.info[instr->definitions[0].tempId()].set_usedef(instr.get());
1987 ctx.info[instr->definitions[0].tempId()].set_minmax(instr.get());
1993 ctx.info[instr->definitions[0].tempId()].set_uniform_bool(instr->operands[2].getTemp());
2003 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
2010 ctx.info[instr->definitions[0].tempId()].set_canonicalized();
2013 if (instr->definitions[0].bytes() == 4) {
2014 ctx.info[instr->definitions[0].tempId()].set_extract(instr.get());
2025 ctx.info[instr->definitions[0].tempId()].set_extract(instr.get());
2026 ctx.info[instr->definitions[0].tempId()].set_bitwise(instr.get());
2034 ctx.info[instr->definitions[0].tempId()].set_usedef(instr.get());
2044 ctx.info[instr->definitions[0].tempId()].set_f2f32(instr.get());
2052 if (!(ctx.info[instr->definitions[0].tempId()].label & (label_neg | label_abs)))
2068 if (!--ctx.uses[instr->definitions[0].tempId()]) {
2086 if (instr->definitions.size() == 2) {
2087 assert(instr->definitions[0].isTemp() && instr->definitions[0].tempId() == op.tempId());
2088 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()])
2100 if (instr->definitions[0].regClass() != ctx.program->lane_mask)
2102 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()])
2182 new_instr->definitions[0] = instr->definitions[0];
2184 ctx.info[instr->definitions[0].tempId()].label = 0;
2185 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr);
2197 if (instr->definitions[0].regClass() != ctx.program->lane_mask)
2199 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()])
2256 new_instr->definitions[0] = instr->definitions[0];
2258 ctx.info[instr->definitions[0].tempId()].label = 0;
2259 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr);
2298 if (instr->definitions[0].regClass() != ctx.program->lane_mask)
2300 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()])
2381 new_instr->definitions[0] = instr->definitions[0];
2383 ctx.info[instr->definitions[0].tempId()].label = 0;
2384 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr);
2397 if (ctx.uses[instr->definitions[1].tempId()])
2460 new_instr->definitions[0] = instr->definitions[0];
2462 ctx.info[instr->definitions[0].tempId()].label = 0;
2463 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr);
2519 *precise = op1_instr->definitions[0].isPrecise() || op2_instr->definitions[0].isPrecise();
2561 new_instr->definitions[0] = instr->definitions[0];
2562 ctx.info[instr->definitions[0].tempId()].label = 0;
2697 if (instr->definitions[1].isTemp() && ctx.uses[instr->definitions[1].tempId()])
2714 std::swap(instr->definitions[0], op2_instr->definitions[0]);
2715 std::swap(instr->definitions[1], op2_instr->definitions[1]);
2717 ctx.info[op2_instr->definitions[0].tempId()].label = 0;
2739 if (instr->definitions[0].isTemp() && ctx.info[instr->definitions[0].tempId()].is_uniform_bool())
2747 if (ctx.uses[op2_instr->definitions[1].tempId()] || fixed_to_exec(op2_instr->operands[0]))
2757 ctx.info[instr->definitions[0].tempId()].label = 0;
2776 if (instr->opcode == aco_opcode::s_add_i32 && ctx.uses[instr->definitions[1].tempId()])
2782 ctx.uses[op2_instr->definitions[1].tempId()])
2798 ctx.info[instr->definitions[0].tempId()].label = 0;
2833 new_instr->definitions[0] = instr->definitions[0];
2834 if (instr->definitions.size() == 2) {
2835 new_instr->definitions[1] = instr->definitions[1];
2837 new_instr->definitions[1] =
2848 ctx.info[instr->definitions[0].tempId()].set_add_sub(instr.get());
2873 new_instr->definitions[0] = instr->definitions[0];
2875 ctx.info[instr->definitions[0].tempId()].label = 0;
3171 if (instr->definitions.empty() || ctx.uses[instr->definitions[0].tempId()] != 1 ||
3183 if (instr->definitions[0].bytes() == 4)
3190 ssa_info& def_info = ctx.info[instr->definitions[0].tempId()];
3197 if (!ctx.uses[def_info.instr->definitions[0].tempId()])
3200 if (def_info.instr->definitions[0].bytes() != instr->definitions[0].bytes())
3204 assert(!ctx.info[instr->definitions[0].tempId()].is_mad());
3218 instr->definitions[0].swapTemp(def_info.instr->definitions[0]);
3219 ctx.info[instr->definitions[0].tempId()].label &= label_clamp | label_insert | label_f2f16;
3220 ctx.uses[def_info.instr->definitions[0].tempId()]--;
3231 if (instr->definitions.empty() || ctx.uses[instr->definitions[0].tempId()] != 1)
3234 ssa_info& def_info = ctx.info[instr->definitions[0].tempId()];
3239 if (!ctx.uses[def_info.instr->definitions[0].tempId()])
3243 assert(!ctx.info[instr->definitions[0].tempId()].is_mad());
3256 instr->definitions[0].swapTemp(def_info.instr->definitions[0]);
3257 ctx.info[instr->definitions[0].tempId()].label = 0;
3258 ctx.uses[def_info.instr->definitions[0].tempId()]--;
3282 unsigned dst_bitsize = extract->definitions[0].bytes() * 8u;
3308 std::swap(ds->definitions[0], extract->definitions[0]);
3309 ctx.uses[extract->definitions[0].tempId()] = 0;
3310 ctx.info[ds->definitions[0].tempId()].label = 0;
3347 new_instr->definitions[0] = instr->definitions[0];
3349 ctx.info[instr->definitions[0].tempId()].label = 0;
3413 new_instr->definitions[0] = instr->definitions[0];
3415 ctx.info[instr->definitions[0].tempId()].label = 0;
3461 instr->definitions[0].swapTemp(candidate->definitions[0]);
3462 ctx.info[candidate->definitions[0].tempId()].instr = candidate;
3463 ctx.uses[instr->definitions[0].tempId()]--;
3508 if (--ctx.uses[fneg->definitions[0].tempId()])
3516 if (fadd && instr->definitions[0].isPrecise())
3531 info.instr->definitions[0].isPrecise())
3558 ctx.uses[mul_instr->definitions[0].tempId()]--;
3559 if (ctx.uses[mul_instr->definitions[0].tempId()]) {
3588 fma->definitions[0] = instr->definitions[0];
3590 ctx.info[instr->definitions[0].tempId()].set_vop3p(instr.get());
3617 instr->definitions[0].isPrecise())
3656 vop3p->definitions[0] = instr->definitions[0];
3660 ctx.info[instr->definitions[0].tempId()].label &= label_f2f16 | label_clamp | label_mul;
3661 if (ctx.info[instr->definitions[0].tempId()].label & label_mul)
3662 ctx.info[instr->definitions[0].tempId()].instr = instr.get();
3668 ssa_info& def_info = ctx.info[instr->definitions[0].tempId()];
3673 if (!can_use_mad_mix(ctx, instr) || ctx.uses[instr->definitions[0].tempId()] != 1)
3676 if (!ctx.uses[conv->definitions[0].tempId()])
3686 instr->definitions[0].swapTemp(conv->definitions[0]);
3687 if (conv->definitions[0].isPrecise())
3688 instr->definitions[0].setPrecise(true);
3689 ctx.info[instr->definitions[0].tempId()].label &= label_clamp;
3690 ctx.uses[conv->definitions[0].tempId()]--;
3740 if (conv->definitions[0].isPrecise())
3741 instr->definitions[0].setPrecise(true);
3787 if (instr->definitions.empty() || is_dead(ctx.uses, instr.get()))
3856 if ((ctx.info[instr->definitions[0].tempId()].label & (label_neg | label_abs)) &&
3858 Temp val = ctx.info[instr->definitions[0].tempId()].temp;
3874 if (mul_instr->definitions[0].bytes() != instr->definitions[0].bytes())
3878 ctx.uses[mul_instr->definitions[0].tempId()]--;
3879 Definition def = instr->definitions[0];
3880 bool is_neg = ctx.info[instr->definitions[0].tempId()].is_neg();
3881 bool is_abs = ctx.info[instr->definitions[0].tempId()].is_abs();
3886 instr->definitions[0] = def;
3903 ctx.info[instr->definitions[0].tempId()].set_mul(instr.get());
3940 if (is_add_mix && info.instr->definitions[0].bytes() == 2)
3943 if (get_operand_size(instr, i) != info.instr->definitions[0].bytes() * 8)
3963 (!(info.instr->definitions[0].isPrecise() || instr->definitions[0].isPrecise()) ||
3980 unsigned cur_idx = mul_instr->definitions[0].tempId();
3981 unsigned new_idx = info.instr->definitions[0].tempId();
3996 ctx.uses[mul_instr->definitions[0].tempId()]--;
3997 if (ctx.uses[mul_instr->definitions[0].tempId()]) {
4070 aco_opcode mad_op = add_instr->definitions[0].bytes() == 2 ? aco_opcode::v_fma_mixlo_f16
4110 instr->definitions[0] = add_instr->definitions[0];
4113 ctx.mad_infos.emplace_back(std::move(add_instr), mul_instr->definitions[0].tempId());
4114 ctx.info[instr->definitions[0].tempId()].set_mad(instr.get(), ctx.mad_infos.size() - 1);
4135 new_instr->definitions[0] = instr->definitions[0];
4137 ctx.info[instr->definitions[0].tempId()].label = 0;
4183 bool carry_out = ctx.uses[instr->definitions[1].tempId()] > 0;
4193 instr->opcode != aco_opcode::v_sub_u32 && ctx.uses[instr->definitions[1].tempId()] > 0;
4224 ctx.info[instr->definitions[0].tempId()].set_mad(instr.get(), ctx.mad_infos.size() - 1);
4279 assert(pred_instr->definitions.size() >= 2);
4280 assert(pred_instr->definitions[1].isFixed() &&
4281 pred_instr->definitions[1].physReg() == scc);
4282 op.setTemp(pred_instr->definitions[1].getTemp());
4290 instr->definitions[0].setTemp(Temp(instr->definitions[0].tempId(), s1));
4311 for (unsigned i = 0, offset = 0; i < instr->definitions.size();
4312 offset += instr->definitions[i++].bytes()) {
4313 if (ctx.uses[instr->definitions[i].tempId()]) {
4333 if (off != instr->operands[0].bytes() && op.bytes() == instr->definitions[idx].bytes()) {
4345 extract->definitions[0] = instr->definitions[idx];
4353 instr->operands[0].bytes() % instr->definitions[idx].bytes() == 0 &&
4354 split_offset % instr->definitions[idx].bytes() == 0) {
4359 Operand::c32((uint32_t)split_offset / instr->definitions[idx].bytes());
4360 extract->definitions[0] = instr->definitions[idx];
4366 if (!instr->definitions.empty() && ctx.info[instr->definitions[0].tempId()].is_mad()) {
4367 mad_info = &ctx.mad_infos[ctx.info[instr->definitions[0].tempId()].instr->pass_flags];
4452 /* Mark SCC needed, so the uniform boolean transformation won't swap the definitions
4463 ctx.info[instr->definitions[0].tempId()].is_scc_needed()) {
4468 instr->definitions[0].setFixed(scc);
4476 if (instr->definitions.size() && ctx.uses[instr->definitions[0].tempId()] == 0 &&
4477 ctx.info[instr->definitions[0].tempId()].is_uniform_bitwise()) {
4480 if (transform_done && !ctx.info[instr->definitions[1].tempId()].is_scc_needed()) {
4483 uint32_t def0_id = instr->definitions[0].getTemp().id();
4484 uint32_t def1_id = instr->definitions[1].getTemp().id();
4485 instr->definitions[0].setTemp(Temp(def1_id, s1));
4486 instr->definitions[1].setTemp(Temp(def0_id, s1));
4526 if (--ctx.uses[info.instr->definitions[0].tempId()])
4726 if (!instr->definitions.empty() && ctx.info[instr->definitions[0].tempId()].is_mad()) {
4727 mad_info* info = &ctx.mad_infos[ctx.info[instr->definitions[0].tempId()].instr->pass_flags];
4755 new_mad->definitions[0] = instr->definitions[0];
4780 if (instr->opcode == aco_opcode::s_add_u32 && ctx.uses[instr->definitions[1].tempId()] == 0 &&