Lines Matching defs:instr
62 Instruction* instr;
191 aco_ptr<Instruction>& instr = block->instructions[idx];
193 if (instr->opcode == aco_opcode::p_linear_phi || instr->opcode == aco_opcode::p_phi)
196 for (const Definition& def : instr->definitions) {
201 for (const Operand& op : instr->operands) {
216 aco_ptr<Instruction>& instr = block->instructions[idx];
217 assert(instr->opcode == aco_opcode::p_linear_phi || instr->opcode == aco_opcode::p_phi);
221 auto it = instr->definitions[0].isTemp() ? next_use_distances_start.find(instr->definitions[0].getTemp())
224 phi_defs.insert(instr->definitions[0].getTemp()).second) {
228 for (unsigned i = 0; i < instr->operands.size(); i++) {
230 instr->opcode == aco_opcode::p_phi ? block->logical_preds[i] : block->linear_preds[i];
231 if (instr->operands[i].isTemp()) {
233 std::make_pair(instr->operands[i].getTemp(), distance));
287 should_rematerialize(aco_ptr<Instruction>& instr)
290 if (instr->format != Format::VOP1 && instr->format != Format::SOP1 &&
291 instr->format != Format::PSEUDO && instr->format != Format::SOPK)
295 if (instr->isPseudo() && instr->opcode != aco_opcode::p_create_vector &&
296 instr->opcode != aco_opcode::p_parallelcopy)
298 if (instr->isSOPK() && instr->opcode != aco_opcode::s_movk_i32)
301 for (const Operand& op : instr->operands) {
308 if (instr->definitions.size() > 1)
319 Instruction* instr = remat->second.instr;
320 assert((instr->isVOP1() || instr->isSOP1() || instr->isPseudo() || instr->isSOPK()) &&
322 assert((instr->format != Format::PSEUDO || instr->opcode == aco_opcode::p_create_vector ||
323 instr->opcode == aco_opcode::p_parallelcopy) &&
325 assert(instr->definitions.size() == 1 && "unsupported");
328 if (instr->isVOP1()) {
330 instr->opcode, instr->format, instr->operands.size(), instr->definitions.size()));
331 } else if (instr->isSOP1()) {
333 instr->opcode, instr->format, instr->operands.size(), instr->definitions.size()));
334 } else if (instr->isPseudo()) {
336 instr->opcode, instr->format, instr->operands.size(), instr->definitions.size()));
337 } else if (instr->isSOPK()) {
339 instr->opcode, instr->format, instr->operands.size(), instr->definitions.size()));
340 res->sopk().imm = instr->sopk().imm;
342 for (unsigned i = 0; i < instr->operands.size(); i++) {
343 res->operands[i] = instr->operands[i];
344 if (instr->operands[i].isTemp()) {
346 if (ctx.remat.count(instr->operands[i].getTemp()))
347 ctx.unused_remats.erase(ctx.remat[instr->operands[i].getTemp()].instr);
367 for (aco_ptr<Instruction>& instr : block.instructions) {
368 if (instr->opcode == aco_opcode::p_logical_start)
370 else if (instr->opcode == aco_opcode::p_logical_end)
372 if (logical && should_rematerialize(instr)) {
373 for (const Definition& def : instr->definitions) {
375 ctx.remat[def.getTemp()] = remat_info{instr.get()};
376 ctx.unused_remats.insert(instr.get());
402 aco_ptr<Instruction>& instr = block->instructions[idx];
403 if (!instr)
405 if (instr->opcode == aco_opcode::p_phi || instr->opcode == aco_opcode::p_linear_phi)
412 for (const Operand& op : instr->operands) {
427 for (const Definition& def : instr->definitions) {
444 aco_ptr<Instruction>& instr = ctx.program->blocks[block_idx].instructions[idx];
446 return get_demand_before(demand, instr, instr_before);
886 ctx.unused_remats.erase(ctx.remat[var].instr);
1008 ctx.unused_remats.erase(remat_it->second.instr);
1122 ctx.unused_remats.erase(ctx.remat[tmp].instr);
1180 aco_ptr<Instruction>& instr = block->instructions[idx];
1185 for (Operand& op : instr->operands) {
1197 ctx.unused_remats.erase(remat_it->second.instr);
1273 instructions.emplace_back(std::move(instr));
1372 aco_ptr<Instruction>& instr = *instr_it;
1373 for (Operand& op : instr->operands) {
1379 if (instr->opcode == aco_opcode::p_spill)
1511 Instruction* instr =
1514 instr->mubuf().sync = memory_sync_info(storage_vgpr_spill, semantic_private);
1521 Instruction* instr = bld.mubuf(aco_opcode::buffer_store_dword, ctx.scratch_rsrc, Operand(v1),
1523 instr->mubuf().sync = memory_sync_info(storage_vgpr_spill, semantic_private);
1552 Instruction* instr =
1555 instr->mubuf().sync = memory_sync_info(storage_vgpr_spill, semantic_private);
1563 Instruction* instr = bld.mubuf(aco_opcode::buffer_load_dword, def, ctx.scratch_rsrc,
1565 instr->mubuf().sync = memory_sync_info(storage_vgpr_spill, semantic_private);
1874 for (aco_ptr<Instruction>& instr : block.instructions) {
1875 if (instr->opcode == aco_opcode::p_phi) {
1878 } else if (instr->opcode != aco_opcode::p_linear_phi) {