Lines Matching defs:PHI
77 static bool IsEquivalentPHI(PHINode *PHI,
79 unsigned PHINumValues = PHI->getNumIncomingValues();
85 if (ValueMapping[PHI->getIncomingBlock(i)] !=
86 PHI->getIncomingValue(i)) {
110 // is relatively slow. If we already have PHI nodes in this block, walk one
147 // Otherwise, we do need a PHI: check to see if we already have one available
163 // Fill in all the predecessors of the PHI.
167 // See if the PHI node can be merged to a single value. This can happen in
168 // loop cases when we get a PHI of itself and one other value.
175 // Set the DebugLoc of the inserted PHI, if available.
184 LLVM_DEBUG(dbgs() << " Inserted PHI: " << *InsertedPHI << "\n");
275 PHINode *PHI;
280 : PHI(P), idx(0) {}
282 : PHI(P), idx(PHI->getNumIncomingValues()) {}
288 Value *getIncomingValue() { return PHI->getIncomingValue(idx); }
289 BasicBlock *getIncomingBlock() { return PHI->getIncomingBlock(idx); }
292 static PHI_iterator PHI_begin(PhiT *PHI) { return PHI_iterator(PHI); }
293 static PHI_iterator PHI_end(PhiT *PHI) {
294 return PHI_iterator(PHI, true);
302 // but it is relatively slow. If we already have PHI nodes in this
316 /// CreateEmptyPHI - Create a new PHI instruction in the specified block.
320 PHINode *PHI =
322 PHI->insertBefore(BB->begin());
323 return PHI;
326 /// AddPHIOperand - Add the specified value as an operand of the PHI for
328 static void AddPHIOperand(PHINode *PHI, Value *Val, BasicBlock *Pred) {
329 PHI->addIncoming(Val, Pred);
332 /// ValueIsPHI - Check if a value is a PHI.
337 /// ValueIsNewPHI - Like ValueIsPHI but also check if the PHI has no source
340 PHINode *PHI = ValueIsPHI(Val, Updater);
341 if (PHI && PHI->getNumIncomingValues() == 0)
342 return PHI;
346 /// GetPHIValue - For the specified PHI instruction, return the value
348 static Value *GetPHIValue(PHINode *PHI) {
349 return PHI;
482 // inserting PHI nodes as necessary.