Lines Matching refs:PHI

3313   while (PHINode *PHI = dyn_cast<PHINode>(I++)) {  in FindPHIForConditionForwarding()  local
3314 int Idx = PHI->getBasicBlockIndex(BB); in FindPHIForConditionForwarding()
3317 Value *InValue = PHI->getIncomingValue(Idx); in FindPHIForConditionForwarding()
3321 return PHI; in FindPHIForConditionForwarding()
3340 PHINode *PHI = FindPHIForConditionForwarding(CaseValue, CaseDest, in ForwardSwitchConditionToPHI() local
3342 if (!PHI) continue; in ForwardSwitchConditionToPHI()
3344 ForwardingNodes[PHI].push_back(PhiIndex); in ForwardSwitchConditionToPHI()
3484 while (PHINode *PHI = dyn_cast<PHINode>(I++)) { in GetCaseResults() local
3485 int Idx = PHI->getBasicBlockIndex(Pred); in GetCaseResults()
3489 Constant *ConstVal = LookupConstant(PHI->getIncomingValue(Idx), in GetCaseResults()
3498 Res.push_back(std::make_pair(PHI, ConstVal)); in GetCaseResults()
3523 static bool InitializeUniqueCases(SwitchInst *SI, PHINode *&PHI, in InitializeUniqueCases() argument
3543 if (!PHI) in InitializeUniqueCases()
3544 PHI = Results[0].first; in InitializeUniqueCases()
3545 else if (PHI != Results[0].first) in InitializeUniqueCases()
3609 static void RemoveSwitchAfterSelectConversion(SwitchInst *SI, PHINode *PHI, in RemoveSwitchAfterSelectConversion() argument
3613 while (PHI->getBasicBlockIndex(SelectBB) >= 0) in RemoveSwitchAfterSelectConversion()
3614 PHI->removeIncomingValue(SelectBB); in RemoveSwitchAfterSelectConversion()
3615 PHI->addIncoming(SelectValue, SelectBB); in RemoveSwitchAfterSelectConversion()
3617 Builder.CreateBr(PHI->getParent()); in RemoveSwitchAfterSelectConversion()
3623 if (Succ == PHI->getParent()) in RemoveSwitchAfterSelectConversion()
3636 PHINode *PHI = nullptr; in SwitchToSelect() local
3641 if (!InitializeUniqueCases(SI, PHI, CommonDest, UniqueResults, DefaultResult, in SwitchToSelect()
3647 assert(PHI != nullptr && "PHI for value select not found"); in SwitchToSelect()
3654 RemoveSwitchAfterSelectConversion(SI, PHI, SelectValue, Builder); in SwitchToSelect()
4090 PHINode *PHI = I.first; in SwitchToLookupTable() local
4092 if (!ResultLists.count(PHI)) in SwitchToLookupTable()
4093 PHIs.push_back(PHI); in SwitchToLookupTable()
4094 ResultLists[PHI].push_back(std::make_pair(CaseVal, Value)); in SwitchToLookupTable()
4099 for (PHINode *PHI : PHIs) { in SwitchToLookupTable()
4100 ResultTypes[PHI] = ResultLists[PHI][0].second->getType(); in SwitchToLookupTable()
4124 PHINode *PHI = I.first; in SwitchToLookupTable() local
4126 DefaultResults[PHI] = Result; in SwitchToLookupTable()
4219 PHINode *PHI = PHIs[I]; in SwitchToLookupTable() local
4220 const ResultListTy &ResultList = ResultLists[PHI]; in SwitchToLookupTable()
4223 Constant *DV = NeedMask ? ResultLists[PHI][0].second : DefaultResults[PHI]; in SwitchToLookupTable()
4230 if (PHI->hasOneUse() && isa<ReturnInst>(*PHI->user_begin()) && in SwitchToLookupTable()
4231 PHI->user_back() == CommonDest->getFirstNonPHIOrDbg()) { in SwitchToLookupTable()
4240 BasicBlock *PhiBlock = PHI->getParent(); in SwitchToLookupTable()
4242 for (auto *User : PHI->users()) { in SwitchToLookupTable()
4247 PHI->addIncoming(Result, LookupBB); in SwitchToLookupTable()
4601 PHINode *PHI = dyn_cast<PHINode>(i); ++i) in removeUndefIntroducingPredecessor()
4602 for (unsigned i = 0, e = PHI->getNumIncomingValues(); i != e; ++i) in removeUndefIntroducingPredecessor()
4603 if (passingValueIsAlwaysUndefined(PHI->getIncomingValue(i), PHI)) { in removeUndefIntroducingPredecessor()
4604 TerminatorInst *T = PHI->getIncomingBlock(i)->getTerminator(); in removeUndefIntroducingPredecessor()
4607 BB->removePredecessor(PHI->getIncomingBlock(i)); in removeUndefIntroducingPredecessor()