Home | History | Annotate | Download | only in src

Lines Matching refs:Phi

29 // Adds an instruction to either the Phi list or the regular instruction list.
43 if (auto *Phi = llvm::dyn_cast<InstPhi>(Instr)) {
45 Func->setError("Phi instruction added to the middle of a block");
48 Phis.push_back(Phi);
61 auto &Phi = llvm::cast<InstPhi>(Inst);
62 for (SizeT i = 0; i < Phi.getSrcSize(); ++i) {
63 if (Phi.getLabel(i) == Old) {
64 Phi.setLabel(i, New);
107 // Ensure each Phi instruction in the node is consistent with respect to control
108 // flow. For each predecessor, there must be a phi argument with that label.
109 // If a phi argument's label doesn't appear in the predecessor list (which can
112 // allows us to remove some dead control flow without a major rework of the phi
113 // instructions. We don't check that phi arguments with the same label have the
117 auto *Phi = llvm::cast<InstPhi>(&Instr);
121 // count how many times each node is referenced in the Phi instruction, and
124 for (SizeT i = 0; i < Phi->getSrcSize(); ++i) {
125 CfgNode *Label = Phi->getLabel(i);
136 Phi->clearOperandForTarget(Label);
141 for (SizeT i = 0; i < Phi->getSrcSize(); ++i) {
142 CfgNode *Label = Phi->getLabel(i);
149 llvm::report_fatal_error("Phi error: missing label for incoming edge");
154 // This does part 1 of Phi lowering, by creating a new dest variable for each
155 // Phi instruction, replacing the Phi instruction's dest with that variable,
158 // a=phi(...)
160 // "a_phi=phi(...); a=a_phi".
162 // This is in preparation for part 2 which deletes the Phi instructions and
167 auto *Phi = llvm::dyn_cast<InstPhi>(&I);
168 Insts.insert(Insts.begin(), Phi->lower(Func));
172 // This does part 2 of Phi lowering. For each Phi instruction at each out-edge,
180 // Note that this transformation takes the Phi dest variables out of SSA form,
196 // better to place the Phi store before the compare so as not to interfere
206 // %100 = phi i8 [ %97, %95 ], [ %110, %108 ]
207 // %101 = phi i1 [ %98, %95 ], [ %111, %108 ]
208 // would be Phi-lowered as:
224 // and a branch target has a Phi involving the branch operand:
226 // %bar = phi i1 [ %foo, %labelSource ], ...
227 // then we actually know the constant i1 value of the Phi operand:
229 // %bar = phi i1 [ true, %labelSource ], ...
235 // matches the Phi-lowered assignment's source.
257 // Consider every Phi instruction at the out-edge.
259 auto *Phi = llvm::dyn_cast<InstPhi>(&I);
260 Operand *Operand = Phi->getOperandForTarget(this);
273 // Deletes the phi instructions after the loads and stores are placed.
343 PhiDesc(InstPhi *Phi, Variable *Dest) : Phi(Phi), Dest(Dest) {}
345 InstPhi *Phi = nullptr;
390 // Update NumPred for all Phi assignments using Var as their Dest variable.
410 // This the "advanced" version of Phi lowering for a basic block, in contrast
413 // All Phi instructions in a basic block are conceptually executed in parallel.
416 // allocation. Delaying Phi scheduling until after register allocation can help
420 // The advanced Phi lowering starts by finding a topological sort of the Phi
436 // original node need to be updated to "undo" the effects of the phi
442 // After phi assignments are lowered across all blocks, another register
455 auto *Phi = llvm::dyn_cast<InstPhi>(&I);
456 if (!Phi->isDeleted()) {
457 Variable *Dest = Phi->getDest();
458 Desc.emplace_back(Phi, Dest);
459 // Undo the effect of the phi instruction on this node's live-in set by
460 // marking the phi dest variable as live on entry.
467 Phi->setDeleted();
482 Operand *Src = Item.Phi->getOperandForTarget(Pred);
499 // Second pass computes NumPred by comparing every pair of Phi instructions.
534 // number of Phi instructions, but with a small constant factor compared to
652 // Do preliminary lowering of the Phi instructions.
705 auto *Phi = llvm::cast<InstPhi>(&I);
706 Phi->livenessPhiOperand(Live, this, Liveness);
721 // number to be that of the earliest phi instruction in the block.
830 // phis are lowered, since each assignment to the phi-based temporary is in a
832 // basic block that contained the actual phi instruction.
1115 // Emitting a Phi instruction should cause an error.
1286 // Emitting a Phi instruction should cause an error.
1601 // Manage Phi instructions of successors
1604 auto *Phi = llvm::cast<InstPhi>(&Inst);
1605 for (SizeT i = 0; i < Phi->getSrcSize(); ++i) {
1606 if (Phi->getLabel(i) == this) {
1607 Phi->addArgument(Phi->getSrc(i), NewNode);