Lines Matching defs:phi
1994 aco_ptr<Instruction>& phi, Temp tmp)
1997 PhysReg reg = get_reg(ctx, register_file, tmp, parallelcopy, phi);
1998 update_renames(ctx, register_file, parallelcopy, phi, rename_not_killed_ops);
2002 /* see if it's a copy from a different phi */
2013 /* if so, just update that phi's register */
2030 /* otherwise, this is a live-in and we need to create a new phi
2043 /* Remove from live_in, because handle_loop_phis() would re-create this phi later if this is
2057 for (aco_ptr<Instruction>& phi : block.instructions) {
2058 if (!is_phi(phi))
2060 if (!phi->definitions[0].isKill())
2061 instructions.emplace_back(std::move(phi));
2065 for (aco_ptr<Instruction>& phi : instructions) {
2066 Definition& definition = phi->definitions[0];
2070 if (!phi->operands[0].isTemp())
2073 PhysReg reg = phi->operands[0].physReg();
2076 bool all_same = std::all_of(phi->operands.cbegin() + 1, phi->operands.cend(), OpsSame);
2080 if (!get_reg_specified(ctx, register_file, definition.regClass(), phi, reg))
2089 for (aco_ptr<Instruction>& phi : instructions) {
2090 Definition& definition = phi->definitions[0];
2099 if (get_reg_specified(ctx, register_file, definition.regClass(), phi, affinity.reg)) {
2108 for (int i = phi->operands.size() - 1; i >= 0; i--) {
2109 const Operand& op = phi->operands[i];
2114 if (get_reg_specified(ctx, register_file, definition.regClass(), phi, reg)) {
2127 aco_ptr<Instruction>& phi = instructions[i];
2128 Definition& definition = phi->definitions[0];
2133 get_reg_phi(ctx, live_in, register_file, instructions, block, phi, definition.getTemp()));
2179 /* the variable has been renamed differently in the predecessors: we need to insert a phi */
2181 aco_ptr<Instruction> phi{
2184 phi->definitions[0] = Definition(new_val);
2189 phi->operands[i] = Operand(ops[i]);
2192 phi->operands[i].setFixed(ctx.assignments[ops[i].id()].reg);
2194 block->instructions.insert(block->instructions.begin(), std::move(phi));
2225 /* update loop-carried values of the phi created by handle_live_in() */
2238 /* rename loop carried phi operands */
2240 aco_ptr<Instruction>& phi = loop_header.instructions[i];
2241 if (!is_phi(phi))
2244 phi->opcode == aco_opcode::p_phi ? loop_header.logical_preds : loop_header.linear_preds;
2245 for (unsigned j = 1; j < phi->operands.size(); j++) {
2246 Operand& op = phi->operands[j];
2250 /* Find the original name, since this operand might not use the original name if the phi
2261 /* return early if no new phi was created */
2293 * the SSA is repaired by inserting corresponding phi-nodes.
2330 /* rename phi operands */
2349 /* due to live-range splits, the live-in might be a phi, now */
2426 /* mark last-seen phi operand */
2432 /* try to coalesce phi affinities with parallelcopies */
2472 /* collect phi affinities */
2512 for (aco_ptr<Instruction>& phi : header_rit->instructions) {
2513 if (!is_phi(phi))
2515 if (phi->definitions[0].isKill() || phi->definitions[0].isFixed())
2518 /* create an (empty) merge-set for the phi-related variables */
2519 auto it = temp_to_phi_ressources.find(phi->definitions[0].tempId());
2522 temp_to_phi_ressources[phi->definitions[0].tempId()] = index;
2523 phi_ressources.emplace_back(std::vector<Temp>{phi->definitions[0].getTemp()});
2527 for (unsigned i = 1; i < phi->operands.size(); i++) {
2528 const Operand& op = phi->operands[i];
2529 if (op.isTemp() && op.isKill() && op.regClass() == phi->definitions[0].regClass()) {
2678 /* this is a slight adjustment from the paper as we already have phi nodes:
2684 * register for the predecessor's branch definitions as if there was a phi.
2724 for (aco_ptr<Instruction>& phi : succ.instructions) {
2725 if (phi->opcode == aco_opcode::p_phi) {
2726 if (phi->operands[idx].isTemp() &&
2727 phi->operands[idx].getTemp().type() == RegType::sgpr &&
2728 phi->operands[idx].isFirstKillBeforeDef()) {
2730 read_variable(ctx, phi->operands[idx].getTemp(), block.index));
2734 } else if (phi->opcode != aco_opcode::p_linear_phi) {