Lines Matching defs:PHI
76 static bool IsEquivalentPHI(PHINode *PHI,
78 unsigned PHINumValues = PHI->getNumIncomingValues();
84 if (ValueMapping[PHI->getIncomingBlock(i)] !=
85 PHI->getIncomingValue(i)) {
109 // is relatively slow. If we already have PHI nodes in this block, walk one
146 // Otherwise, we do need a PHI: check to see if we already have one available
162 // Fill in all the predecessors of the PHI.
166 // See if the PHI node can be merged to a single value. This can happen in
167 // loop cases when we get a PHI of itself and one other value.
174 // Set the DebugLoc of the inserted PHI, if available.
183 LLVM_DEBUG(dbgs() << " Inserted PHI: " << *InsertedPHI << "\n");
274 PHINode *PHI;
279 : PHI(P), idx(0) {}
281 : PHI(P), idx(PHI->getNumIncomingValues()) {}
287 Value *getIncomingValue() { return PHI->getIncomingValue(idx); }
288 BasicBlock *getIncomingBlock() { return PHI->getIncomingBlock(idx); }
291 static PHI_iterator PHI_begin(PhiT *PHI) { return PHI_iterator(PHI); }
292 static PHI_iterator PHI_end(PhiT *PHI) {
293 return PHI_iterator(PHI, true);
301 // but it is relatively slow. If we already have PHI nodes in this
315 /// CreateEmptyPHI - Create a new PHI instruction in the specified block.
319 PHINode *PHI =
321 PHI->insertBefore(BB->begin());
322 return PHI;
325 /// AddPHIOperand - Add the specified value as an operand of the PHI for
327 static void AddPHIOperand(PHINode *PHI, Value *Val, BasicBlock *Pred) {
328 PHI->addIncoming(Val, Pred);
331 /// ValueIsPHI - Check if a value is a PHI.
336 /// ValueIsNewPHI - Like ValueIsPHI but also check if the PHI has no source
339 PHINode *PHI = ValueIsPHI(Val, Updater);
340 if (PHI && PHI->getNumIncomingValues() == 0)
341 return PHI;
345 /// GetPHIValue - For the specified PHI instruction, return the value
347 static Value *GetPHIValue(PHINode *PHI) {
348 return PHI;
488 // inserting PHI nodes as necessary.