Lines Matching refs:phi
100 /* Return if this was handled in a recursive call by a loop header phi */
109 /* create phi */
110 aco_ptr<Pseudo_instruction> phi{
113 phi->operands[i] = ops[i];
114 phi->definitions[0] = Definition(op.getTemp());
115 block.instructions.emplace(block.instructions.begin(), std::move(phi));
196 init_any_pred_defined(Program* program, ssa_state* state, Block* block, aco_ptr<Instruction>& phi)
200 if (phi->operands[i].isUndefined())
203 if (phi->operands[i].isConstant())
204 defined = phi->operands[i].constantValue() ? pred_defined::const_1 : pred_defined::const_0;
216 /* If the loop-header has a back-edge, we need to insert a phi.
253 aco_ptr<Instruction>& phi)
267 phi->opcode = aco_opcode::p_linear_phi;
279 init_any_pred_defined(program, state, block, phi);
281 for (unsigned i = 0; i < phi->operands.size(); i++) {
286 state->outputs[pred] = phi->operands[i];
291 for (unsigned i = 0; i < phi->operands.size(); i++)
292 build_merge_code(program, state, &program->blocks[block->logical_preds[i]], phi->operands[i]);
295 if (phi->operands.size() != num_preds) {
298 new_phi->definitions[0] = phi->definitions[0];
299 phi.reset(new_phi);
301 phi->opcode = aco_opcode::p_linear_phi;
303 assert(phi->operands.size() == num_preds);
306 phi->operands[i] = get_ssa(program, block->linear_preds[i], state, false);
312 lower_subdword_phis(Program* program, Block* block, aco_ptr<Instruction>& phi)
315 for (unsigned i = 0; i < phi->operands.size(); i++) {
316 if (phi->operands[i].isUndefined())
318 if (phi->operands[i].regClass() == phi->definitions[0].regClass())
321 assert(phi->operands[i].isTemp());
323 Temp phi_src = phi->operands[i].getTemp();
328 Temp new_phi_src = bld.tmp(phi->definitions[0].regClass());
333 phi->operands[i].setTemp(new_phi_src);
345 for (aco_ptr<Instruction>& phi : block.instructions) {
346 if (phi->opcode == aco_opcode::p_phi) {
347 assert(program->wave_size == 64 ? phi->definitions[0].regClass() != s1
348 : phi->definitions[0].regClass() != s2);
349 if (phi->definitions[0].regClass() == program->lane_mask)
350 lower_divergent_bool_phi(program, &state, &block, phi);
351 else if (phi->definitions[0].regClass().is_subdword())
352 lower_subdword_phis(program, &block, phi);
353 } else if (!is_phi(phi)) {