Lines Matching defs:Phi

89     MemoryPhi *Phi = dyn_cast_or_null<MemoryPhi>(MSSA->getMemoryAccess(BB));
92 auto *Result = tryRemoveTrivialPhi(Phi, PhiOps);
94 if (Result == Phi && UniqueIncomingAccess && SingleAccess) {
95 // A concrete Phi only exists if we created an empty one to break a cycle.
96 if (Phi) {
97 assert(Phi->operands().empty() && "Expected empty Phi");
98 Phi->replaceAllUsesWith(SingleAccess);
99 removeMemoryAccess(Phi);
102 } else if (Result == Phi && !(UniqueIncomingAccess && SingleAccess)) {
103 if (!Phi)
104 Phi = MSSA->createMemoryPhi(BB);
109 if (Phi->getNumOperands() != 0) {
111 if (!std::equal(Phi->op_begin(), Phi->op_end(), PhiOps.begin())) {
113 llvm::copy(PhiOps, Phi->op_begin());
114 std::copy(pred_begin(BB), pred_end(BB), Phi->block_begin());
119 Phi->addIncoming(&*PhiOps[i++], Pred);
120 InsertedPHIs.push_back(Phi);
122 Result = Phi;
185 MemoryAccess *MemorySSAUpdater::recursePhi(MemoryAccess *Phi) {
186 if (!Phi)
188 TrackingVH<MemoryAccess> Res(Phi);
190 std::copy(Phi->user_begin(), Phi->user_end(), std::back_inserter(Uses));
202 MemoryAccess *MemorySSAUpdater::tryRemoveTrivialPhi(MemoryPhi *Phi) {
203 assert(Phi && "Can only remove concrete Phi.");
204 auto OperRange = Phi->operands();
205 return tryRemoveTrivialPhi(Phi, OperRange);
208 MemoryAccess *MemorySSAUpdater::tryRemoveTrivialPhi(MemoryPhi *Phi,
211 if (NonOptPhis.count(Phi))
212 return Phi;
218 if (Op == Phi || Op == Same)
222 return Phi;
228 if (Phi) {
229 Phi->replaceAllUsesWith(Same);
230 removeMemoryAccess(Phi);
260 "Block may have only a Phi or no defs");
279 if (MemoryPhi *Phi = cast_or_null<MemoryPhi>(MP))
280 MSSA->renamePass(Phi->getBlock(), nullptr, Visited);
448 MemoryPhi *Phi = dyn_cast_or_null<MemoryPhi>(MP);
449 if (Phi)
450 MSSA->renamePass(Phi->getBlock(), nullptr, Visited);
452 // Existing Phi blocks may need renaming too, if an access was previously
455 MemoryPhi *Phi = dyn_cast_or_null<MemoryPhi>(MP);
456 if (Phi)
457 MSSA->renamePass(Phi->getBlock(), nullptr, Visited);
473 // The temporary Phi is being fixed, unmark it for not to optimize.
474 if (MemoryPhi *Phi = dyn_cast<MemoryPhi>(NewDef))
475 NonOptPhis.erase(Phi);
680 auto FixPhiIncomingValues = [&](MemoryPhi *Phi, MemoryPhi *NewPhi) {
681 assert(Phi && NewPhi && "Invalid Phi nodes.");
685 for (unsigned It = 0, E = Phi->getNumIncomingValues(); It < E; ++It) {
686 MemoryAccess *IncomingAccess = Phi->getIncomingValue(It);
687 BasicBlock *IncBB = Phi->getIncomingBlock(It);
708 MPhiMap[Phi] = SingleAccess;
744 // VM. The uses of BB's Phi (if it exists) in BB will be replaced by the
745 // incoming def into the Phi from P1.
858 // Return last Def or Phi in BB, if it exists.
1019 // If Phi is not empty, add an incoming edge from each added pred. Must
1050 // Update Phi with new values for new predecessors and old value for all
1103 assert(IDFPhi && "Phi must exist");
1105 // Update existing Phi.
1224 // If all accesses were moved and only a trivial Phi remains, we try to remove
1225 // that Phi. This is needed when From is going to be deleted.
1228 if (auto *Phi = dyn_cast<MemoryPhi>(&*Defs->begin()))
1229 tryRemoveTrivialPhi(Phi);
1258 MemoryPhi *Phi = MSSA->getMemoryAccess(Old);
1259 if (!Phi)
1264 MSSA->moveTo(Phi, New, MemorySSA::Beginning);
1276 Phi->unorderedDeleteIncomingIf([&](MemoryAccess *MA, BasicBlock *B) {
1285 Phi->addIncoming(NewPhi, New);
1343 // Optionally optimize Phi uses. This will recursively remove trivial phis.