Lines Matching refs:info

504    ssa_info* info;
626 ssa_info& info = ctx.info[instr->definitions[i].tempId()];
627 if (info.label & instr_usedef_labels && info.instr == tmp.get())
628 info.instr = instr.get();
651 ssa_info& info = ctx.info[instr->definitions[i].tempId()];
652 if (info.label & instr_labels && info.instr == tmp.get())
653 info.instr = instr.get();
753 if (!ctx.info[tmp.id()].is_add_sub())
756 Instruction* add_instr = ctx.info[tmp.id()].instr;
793 ctx.info[add_instr->operands[i].tempId()].is_constant_or_literal(32)) {
794 *offset = ctx.info[add_instr->operands[i].tempId()].val * (uint32_t)(is_sub ? -1 : 1);
824 if (!op.isTemp() || !ctx.info[op.tempId()].is_bitwise())
827 Instruction* bitwise_instr = ctx.info[op.tempId()].instr;
849 ssa_info info = ctx.info[instr->operands[1].tempId()];
854 if (info.is_constant_or_literal(32) &&
855 ((ctx.program->gfx_level == GFX6 && info.val <= 0x3FF) ||
856 (ctx.program->gfx_level == GFX7 && info.val <= 0xFFFFFFFF) ||
857 (ctx.program->gfx_level >= GFX8 && info.val <= 0xFFFFF))) {
858 instr->operands[1] = Operand::c32(info.val);
864 if (ctx.info[smem.operands.back().tempId()].is_constant_or_literal(32) &&
865 ctx.info[smem.operands.back().tempId()].val == 0) {
912 get_constant_op(opt_ctx& ctx, ssa_info info, uint32_t bits)
915 return Operand::c32_or_c64(info.val, true);
916 return Operand::get_const(ctx.program->gfx_level, info.val, bits / 8u);
920 propagate_constants_vop3p(opt_ctx& ctx, aco_ptr<Instruction>& instr, ssa_info& info, unsigned i)
922 if (!info.is_constant_or_literal(32))
927 if (info.is_constant(bits)) {
928 instr->operands[i] = get_constant_op(ctx, info, bits);
951 uint16_t val = info.val >> (j ? 16 : 0);
1063 can_apply_extract(opt_ctx& ctx, aco_ptr<Instruction>& instr, unsigned idx, ssa_info& info)
1068 Temp tmp = info.instr->operands[0].getTemp();
1069 SubdwordSel sel = parse_extract(info.instr);
1107 apply_extract(opt_ctx& ctx, aco_ptr<Instruction>& instr, unsigned idx, ssa_info& info)
1109 Temp tmp = info.instr->operands[0].getTemp();
1110 SubdwordSel sel = parse_extract(info.instr);
1116 ctx.info[tmp.id()].label &= ~label_insert;
1158 ctx.info[def.tempId()].label &= (label_vopc | label_f2f32 | instr_mod_labels);
1168 ssa_info& info = ctx.info[op.tempId()];
1169 if (info.is_extract() && (info.instr->operands[0].getTemp().type() == RegType::vgpr ||
1171 if (!can_apply_extract(ctx, instr, i, info))
1172 info.label &= ~label_extract;
1199 if (ctx.info[tmp.id()].is_canonicalized() ||
1210 if (ctx.info[tmp.id()].is_vopc()) {
1211 Instruction* vopc_instr = ctx.info[tmp.id()].instr;
1216 if (ctx.info[tmp.id()].is_bitwise()) {
1217 Instruction* instr = ctx.info[tmp.id()].instr;
1229 is_copy_label(opt_ctx& ctx, aco_ptr<Instruction>& instr, ssa_info& info)
1231 return info.is_temp() ||
1232 (info.is_fcanonicalize() && can_eliminate_fcanonicalize(ctx, instr, info.temp));
1239 if ((op.isTemp() && ctx.info[op.tempId()].is_canonicalized()) ||
1243 if (op.isConstant() || (op.isTemp() && ctx.info[op.tempId()].is_constant_or_literal(32))) {
1244 uint32_t val = op.isTemp() ? ctx.info[op.tempId()].val : op.constantValue();
1274 all_const && (!op.isTemp() || ctx.info[op.tempId()].is_constant_or_literal(32));
1291 ssa_info info = ctx.info[instr->operands[i].tempId()];
1293 if (info.is_undefined() && is_phi(instr))
1296 while (info.is_temp() && info.temp.regClass() == instr->operands[i].getTemp().regClass()) {
1297 instr->operands[i].setTemp(ctx.info[instr->operands[i].tempId()].temp);
1298 info = ctx.info[info.temp.id()];
1303 while (info.is_temp()) {
1304 pseudo_propagate_temp(ctx, instr, info.temp, i);
1305 info = ctx.info[info.temp.id()];
1312 if ((info.is_constant(bits) || (info.is_literal(bits) && instr->isPseudo())) &&
1314 instr->operands[i] = get_constant_op(ctx, info, bits);
1321 if (is_copy_label(ctx, instr, info) && info.temp.type() == RegType::vgpr &&
1323 instr->operands[i].setTemp(info.temp);
1324 info = ctx.info[info.temp.id()];
1327 if (info.is_temp() && info.temp.type() == RegType::sgpr && can_apply_sgprs(ctx, instr) &&
1330 instr->operands[i].setTemp(info.temp);
1331 info = ctx.info[info.temp.id()];
1348 if (info.is_neg() && instr->opcode == aco_opcode::v_add_f32 && mod_bitsize_compat) {
1350 instr->operands[i].setTemp(info.temp);
1351 } else if (info.is_neg() && instr->opcode == aco_opcode::v_add_f16 && mod_bitsize_compat) {
1353 instr->operands[i].setTemp(info.temp);
1354 } else if (info.is_neg() && can_use_mod && mod_bitsize_compat &&
1355 can_eliminate_fcanonicalize(ctx, instr, info.temp)) {
1358 instr->operands[i].setTemp(info.temp);
1366 if (info.is_abs() && can_use_mod && mod_bitsize_compat &&
1367 can_eliminate_fcanonicalize(ctx, instr, info.temp)) {
1370 instr->operands[i] = Operand(info.temp);
1381 propagate_constants_vop3p(ctx, instr, info, i);
1385 if (info.is_constant(bits) && alu_can_accept_constant(instr->opcode, i) &&
1387 Operand op = get_constant_op(ctx, info, bits);
1412 while (info.is_temp())
1413 info = ctx.info[info.temp.id()];
1423 if (mubuf.offen && i == 1 && info.is_constant_or_literal(32) &&
1424 mubuf.offset + info.val < 4096) {
1427 mubuf.offset += info.val;
1430 } else if (i == 2 && info.is_constant_or_literal(32) && mubuf.offset + info.val < 4096) {
1432 mubuf.offset += info.val;
1455 while (info.is_temp())
1456 info = ctx.info[info.temp.id()];
1464 } else if (i <= 1 && info.is_constant_or_literal(32) &&
1466 is_scratch_offset_valid(ctx, NULL, scratch.offset + (int32_t)info.val)) {
1469 scratch.offset += (int32_t)info.val;
1520 if (ctx.info[instr->operands[0].tempId()].is_scc_invert()) {
1524 instr->operands[0].setTemp(ctx.info[instr->operands[0].tempId()].temp);
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());
1564 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1575 if (aligned && op.isTemp() && ctx.info[op.tempId()].is_vec()) {
1576 Instruction* vec = ctx.info[op.tempId()].instr;
1591 if (ops[i].isTemp() && ctx.info[ops[i].tempId()].is_temp() &&
1592 ops[i].regClass() == ctx.info[ops[i].tempId()].temp.regClass())
1593 ops[i].setTemp(ctx.info[ops[i].tempId()].temp);
1602 ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
1606 if (instr->operands[1].isTemp() && ctx.info[instr->operands[1].tempId()].is_split()) {
1607 Instruction* split = ctx.info[instr->operands[1].tempId()].instr;
1610 ctx.info[instr->definitions[0].tempId()].set_temp(split->operands[0].getTemp());
1616 ssa_info& info = ctx.info[instr->operands[0].tempId()];
1618 if (info.is_constant_or_literal(32)) {
1619 uint64_t val = info.val;
1622 ctx.info[def.tempId()].set_constant(ctx.program->gfx_level, val & mask);
1626 } else if (!info.is_vec()) {
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());
1639 Instruction* vec = ctx.info[instr->operands[0].tempId()].instr;
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());
1666 ssa_info& info = ctx.info[instr->operands[0].tempId()];
1670 if (info.is_vec()) {
1672 Instruction* vec = info.instr;
1685 } else if (info.is_constant_or_literal(32)) {
1688 uint32_t val = (info.val >> (dst_offset * 8u)) & mask;
1699 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1701 ctx.info[instr->definitions[0].tempId()].set_extract(instr.get());
1711 if (instr->operands[0].isTemp() && ctx.info[instr->operands[0].tempId()].is_vec() &&
1716 Instruction* vec = ctx.info[instr->operands[0].tempId()].instr;
1725 if (op.isTemp() && ctx.info[op.tempId()].is_temp() &&
1726 ctx.info[op.tempId()].temp.type() == instr->definitions[0].regClass().type())
1727 op.setTemp(ctx.info[op.tempId()].temp);
1729 ctx.info[instr->definitions[0].tempId()].set_vec(instr.get());
1739 ctx.info[instr->definitions[0].tempId()].set_constant(
1742 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
1743 if (ctx.info[instr->operands[0].tempId()].is_canonicalized())
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);
1799 ctx.info[instr->operands[i].tempId()].set_omod2(instr.get());
1802 ctx.info[instr->operands[i].tempId()].set_omod4(instr.get());
1805 ctx.info[instr->operands[i].tempId()].set_omod5(instr.get());
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());
1843 ctx.info[instr->operands[idx].tempId()].set_clamp(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());
1859 ctx.info[instr->operands[1].tempId()].is_vcc())
1860 ctx.info[instr->definitions[0].tempId()].set_temp(
1861 ctx.info[instr->operands[1].tempId()].temp);
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());
1906 if (ctx.info[instr->operands[0].tempId()].is_uniform_bool()) {
1907 ctx.info[instr->definitions[0].tempId()].set_uniform_bitwise();
1908 ctx.info[instr->definitions[1].tempId()].set_scc_invert(
1909 ctx.info[instr->operands[0].tempId()].temp);
1910 } else if (ctx.info[instr->operands[0].tempId()].is_uniform_bitwise()) {
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());
1920 if (ctx.info[instr->operands[0].tempId()].is_uniform_bool()) {
1923 ctx.info[instr->definitions[1].tempId()].set_temp(
1924 ctx.info[instr->operands[0].tempId()].temp);
1925 ctx.info[instr->definitions[0].tempId()].set_uniform_bool(
1926 ctx.info[instr->operands[0].tempId()].temp);
1928 } else if (ctx.info[instr->operands[0].tempId()].is_uniform_bitwise()) {
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());
1956 return op.isTemp() && (ctx.info[op.tempId()].is_uniform_bool() ||
1957 ctx.info[op.tempId()].is_uniform_bitwise());
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());
1995 if (instr->operands[2].isTemp() && ctx.info[instr->operands[2].tempId()].is_scc_invert()) {
1998 instr->operands[2].setTemp(ctx.info[instr->operands[2].tempId()].temp);
2002 if (instr->operands[0].isTemp() && ctx.info[instr->operands[0].tempId()].is_scc_invert()) {
2003 ctx.info[instr->definitions[0].tempId()].set_temp(instr->operands[0].getTemp());
2010 ctx.info[instr->definitions[0].tempId()].set_canonicalized();
2014 ctx.info[instr->definitions[0].tempId()].set_extract(instr.get());
2016 ctx.info[instr->operands[0].tempId()].set_insert(instr.get());
2023 ctx.info[instr->operands[0].tempId()].set_insert(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());
2039 ctx.info[instr->operands[0].tempId()].set_f2f16(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)))
2059 if (ctx.info[tmp.id()].is_temp())
2060 return ctx.info[tmp.id()].temp.id();
2079 if (!op.isTemp() || !(ctx.info[op.tempId()].label & instr_usedef_labels))
2084 Instruction* instr = ctx.info[op.tempId()].instr;
2184 ctx.info[instr->definitions[0].tempId()].label = 0;
2185 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr);
2258 ctx.info[instr->definitions[0].tempId()].label = 0;
2259 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr);
2274 if (!ctx.info[id].is_constant_or_literal(bit_size))
2276 *value = get_constant_op(ctx, ctx.info[id], bit_size).constantValue64();
2383 ctx.info[instr->definitions[0].tempId()].label = 0;
2384 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr);
2462 ctx.info[instr->definitions[0].tempId()].label = 0;
2463 ctx.info[instr->definitions[0].tempId()].set_vopc(new_instr);
2562 ctx.info[instr->definitions[0].tempId()].label = 0;
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())
2757 ctx.info[instr->definitions[0].tempId()].label = 0;
2798 ctx.info[instr->definitions[0].tempId()].label = 0;
2818 if (instr->operands[i].isTemp() && ctx.info[instr->operands[i].tempId()].is_b2i() &&
2846 new_instr->operands[2] = Operand(ctx.info[instr->operands[i].tempId()].temp);
2848 ctx.info[instr->definitions[0].tempId()].set_add_sub(instr.get());
2875 ctx.info[instr->definitions[0].tempId()].label = 0;
2963 ctx.info[operands[i].tempId()].is_constant_or_literal(32)) {
2964 val = ctx.info[operands[i].tempId()].val >> (hi16 ? 16 : 0);
3068 ssa_info& info = ctx.info[instr->operands[i].tempId()];
3069 if (is_copy_label(ctx, instr, info) && info.temp.type() == RegType::sgpr)
3071 if (info.is_extract() && info.instr->operands[0].getTemp().type() == RegType::sgpr)
3098 ssa_info& info = ctx.info[sgpr_info_id];
3103 if (!info.is_extract() && num_sgprs && ctx.uses[sgpr_info_id] > 1 && !instr->isVOP3() &&
3107 Temp sgpr = info.is_extract() ? info.instr->operands[0].getTemp() : info.temp;
3116 info.is_extract()) {
3118 if (info.is_extract() && can_apply_extract(ctx, instr, sgpr_idx, info))
3119 apply_extract(ctx, instr, sgpr_idx, info);
3120 else if (info.is_extract())
3129 } else if (can_use_VOP3(ctx, instr) && !info.is_extract()) {
3142 if ((ctx.info[sgpr.id()].label & (label_extract | label_temp)) &&
3143 ctx.info[sgpr.id()].temp.type() == RegType::sgpr)
3190 ssa_info& def_info = ctx.info[instr->definitions[0].tempId()];
3204 assert(!ctx.info[instr->definitions[0].tempId()].is_mad());
3219 ctx.info[instr->definitions[0].tempId()].label &= label_clamp | label_insert | label_f2f16;
3234 ssa_info& def_info = ctx.info[instr->definitions[0].tempId()];
3243 assert(!ctx.info[instr->definitions[0].tempId()].is_mad());
3257 ctx.info[instr->definitions[0].tempId()].label = 0;
3270 if (!ctx.info[extract->operands[0].tempId()].is_usedef() ||
3275 Instruction* ds = ctx.info[extract->operands[0].tempId()].instr;
3310 ctx.info[ds->definitions[0].tempId()].label = 0;
3349 ctx.info[instr->definitions[0].tempId()].label = 0;
3415 ctx.info[instr->definitions[0].tempId()].label = 0;
3456 ssa_info& info = ctx.info[instr->operands[0].tempId()];
3457 if (info.is_vop3p() && instr_info.can_use_output_modifiers[(int)info.instr->opcode]) {
3458 VOP3P_instruction* candidate = &ctx.info[instr->operands[0].tempId()].instr->vop3p();
3462 ctx.info[candidate->definitions[0].tempId()].instr = candidate;
3475 ssa_info& info = ctx.info[op.tempId()];
3476 if (info.is_vop3p() && info.instr->opcode == aco_opcode::v_pk_mul_f16 &&
3477 info.instr->operands[1].constantEquals(0x3C00)) {
3479 VOP3P_instruction* fneg = &info.instr->vop3p();
3487 ops[i] = info.instr->operands[0];
3526 if (!instr->operands[i].isTemp() || !ctx.info[instr->operands[i].tempId()].is_vop3p())
3528 ssa_info& info = ctx.info[instr->operands[i].tempId()];
3530 if (info.instr->opcode != aco_opcode::v_pk_mul_f16 ||
3531 info.instr->definitions[0].isPrecise())
3534 if (info.instr->opcode != aco_opcode::v_pk_mul_lo_u16)
3538 Operand op[3] = {info.instr->operands[0], info.instr->operands[1], instr->operands[1 - i]};
3543 if (info.instr->vop3p().clamp)
3546 mul_instr = info.instr;
3590 ctx.info[instr->definitions[0].tempId()].set_vop3p(instr.get());
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()];
3689 ctx.info[instr->definitions[0].tempId()].label &= label_clamp;
3705 if (!ctx.info[tmp.id()].is_f2f32())
3708 Instruction* conv = ctx.info[tmp.id()].instr;
3761 if (op.isTemp() && ctx.info[op.tempId()].is_constant_or_literal(op.bytes() * 8))
3762 return is_pow_of_two(ctx, get_constant_op(ctx, ctx.info[op.tempId()], op.bytes() * 8));
3797 ssa_info& info = ctx.info[op.tempId()];
3798 if (!info.is_extract())
3803 info.label &= ~label_extract;
3806 if (info.is_extract() &&
3807 (info.instr->operands[0].getTemp().type() == RegType::vgpr ||
3809 can_apply_extract(ctx, instr, i, info)) {
3811 apply_extract(ctx, instr, i, info);
3813 ctx.uses[info.instr->operands[0].tempId()]++;
3814 instr->operands[i].setTemp(info.instr->operands[0].getTemp());
3834 ssa_info& info = ctx.info[instr->operands[0].tempId()];
3835 if (info.is_extract() && can_apply_extract(ctx, instr, 0, info)) {
3836 apply_extract(ctx, instr, 0, info);
3838 ctx.uses[info.instr->operands[0].tempId()]++;
3839 instr->operands[0].setTemp(info.instr->operands[0].getTemp());
3856 if ((ctx.info[instr->definitions[0].tempId()].label & (label_neg | label_abs)) &&
3858 Temp val = ctx.info[instr->definitions[0].tempId()].temp;
3860 if (!ctx.info[val.id()].is_mul())
3863 Instruction* mul_instr = ctx.info[val.id()].instr;
3880 bool is_neg = ctx.info[instr->definitions[0].tempId()].is_neg();
3881 bool is_abs = ctx.info[instr->definitions[0].tempId()].is_abs();
3903 ctx.info[instr->definitions[0].tempId()].set_mul(instr.get());
3927 if (!instr->operands[i].isTemp() || !ctx.info[instr->operands[i].tempId()].is_mul())
3929 ssa_info& info = ctx.info[instr->operands[i].tempId()];
3932 if (info.instr->isVOP3() && (info.instr->vop3().clamp || info.instr->vop3().omod))
3934 if (info.instr->isVOP3P() && info.instr->vop3p().clamp)
3937 if (info.instr->isVOP3P() && instr->isVOP3() && instr->vop3().omod)
3940 if (is_add_mix && info.instr->definitions[0].bytes() == 2)
3943 if (get_operand_size(instr, i) != info.instr->definitions[0].bytes() * 8)
3946 bool legacy = info.instr->opcode == aco_opcode::v_mul_legacy_f32;
3947 bool mad_mix = is_add_mix || info.instr->isVOP3P();
3952 bool is_fma_precise = is_pow_of_two(ctx, info.instr->operands[0]) ||
3953 is_pow_of_two(ctx, info.instr->operands[1]);
3963 (!(info.instr->definitions[0].isPrecise() || instr->definitions[0].isPrecise()) ||
3973 Operand op[3] = {info.instr->operands[0], info.instr->operands[1],
3975 if (info.instr->isSDWA() || info.instr->isDPP() || !check_vop3_operands(ctx, 3, op) ||
3981 unsigned new_idx = info.instr->definitions[0].tempId();
3986 mul_instr = info.instr;
4114 ctx.info[instr->definitions[0].tempId()].set_mad(instr.get(), ctx.mad_infos.size() - 1);
4124 if (instr->operands[i].isTemp() && ctx.info[instr->operands[i].tempId()].is_b2f() &&
4128 ctx.uses[ctx.info[instr->operands[i].tempId()].temp.id()]++;
4134 new_instr->operands[2] = Operand(ctx.info[instr->operands[i].tempId()].temp);
4137 ctx.info[instr->definitions[0].tempId()].label = 0;
4224 ctx.info[instr->definitions[0].tempId()].set_mad(instr.get(), ctx.mad_infos.size() - 1);
4250 if (!ctx.info[op.tempId()].is_uniform_bool() && !ctx.info[op.tempId()].is_uniform_bitwise())
4269 if (ctx.info[op.tempId()].is_uniform_bool()) {
4271 op.setTemp(ctx.info[op.tempId()].temp);
4272 } else if (ctx.info[op.tempId()].is_uniform_bitwise()) {
4278 Instruction* pred_instr = ctx.info[op.tempId()].instr;
4320 if (num_used == 1 && ctx.info[instr->operands[0].tempId()].is_vec() &&
4322 Instruction* vec = ctx.info[instr->operands[0].tempId()].instr;
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];
4398 ctx.info[instr->operands[2].tempId()].is_literal(get_operand_size(instr, 2))) {
4428 if (ctx.info[instr->operands[i].tempId()].is_literal(get_operand_size(instr, i)) &&
4456 ctx.info[instr->operands[0].tempId()].set_scc_needed();
4461 ctx.info[instr->operands[2].tempId()].set_scc_needed();
4463 ctx.info[instr->definitions[0].tempId()].is_scc_needed()) {
4465 ctx.info[instr->operands[0].tempId()].set_scc_needed();
4477 ctx.info[instr->definitions[0].tempId()].is_uniform_bitwise()) {
4480 if (transform_done && !ctx.info[instr->definitions[1].tempId()].is_scc_needed()) {
4497 ssa_info info = ctx.info[instr->operands[i].tempId()];
4500 if (info.is_dpp() && info.instr->pass_flags == instr->pass_flags &&
4502 can_use_DPP(instr, true, info.is_dpp8()) && !instr->isDPP()) {
4503 bool dpp8 = info.is_dpp8();
4508 dpp->lane_sel[j] = info.instr->dpp8().lane_sel[j];
4521 dpp->dpp_ctrl = info.instr->dpp16().dpp_ctrl;
4522 dpp->bound_ctrl = info.instr->dpp16().bound_ctrl;
4523 dpp->neg[0] ^= info.instr->dpp16().neg[0] && !dpp->abs[0];
4524 dpp->abs[0] |= info.instr->dpp16().abs[0];
4526 if (--ctx.uses[info.instr->definitions[0].tempId()])
4527 ctx.uses[info.instr->operands[0].tempId()]++;
4528 instr->operands[0].setTemp(info.instr->operands[0].getTemp());
4568 } else if (!op.isTemp() || !ctx.info[op.tempId()].is_literal(bits)) {
4578 literal = Operand::c32(ctx.info[op.tempId()].val);
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];
4728 if (info->check_literal &&
4729 (ctx.uses[instr->operands[info->literal_idx].tempId()] == 0 || info->literal_idx == 2)) {
4733 info->literal_idx == 2 ? aco_opcode::v_madak_f32 : aco_opcode::v_madmk_f32;
4735 new_op = info->literal_idx == 2 ? aco_opcode::v_fmaak_f32 : aco_opcode::v_fmamk_f32;
4738 new_op = info->literal_idx == 2 ? aco_opcode::v_madak_f16 : aco_opcode::v_madmk_f16;
4740 new_op = info->literal_idx == 2 ? aco_opcode::v_fmaak_f16 : aco_opcode::v_fmamk_f16;
4743 if (info->literal_idx == 2) { /* add literal -> madak */
4750 new_mad->operands[0] = instr->operands[1 - info->literal_idx];
4754 Operand::c32(ctx.info[instr->operands[info->literal_idx].tempId()].val);
4766 if (op.isTemp() && ctx.info[op.tempId()].is_literal(bits) && ctx.uses[op.tempId()] == 0) {
4767 Operand literal = Operand::literal32(ctx.info[op.tempId()].val);
4792 std::vector<ssa_info> info(program->peekAllocationId());
4793 ctx.info = info.data();