Lines Matching refs:PN
674 bool SCEVExpander::isNormalAddRecExprPHI(PHINode *PN, Instruction *IncV, in isNormalAddRecExprPHI() argument
696 if (IncV == PN) in isNormalAddRecExprPHI()
699 return isNormalAddRecExprPHI(PN, IncV, L); in isNormalAddRecExprPHI()
838 bool SCEVExpander::isExpandedAddRecExprPHI(PHINode *PN, Instruction *IncV, in isExpandedAddRecExprPHI() argument
843 if (IVOper == PN) in isExpandedAddRecExprPHI()
852 Value *SCEVExpander::expandIVInc(PHINode *PN, Value *StepV, const Loop *L, in expandIVInc() argument
856 if (PN->getType()->isPointerTy()) { in expandIVInc()
858 IncV = Builder.CreatePtrAdd(PN, StepV, "scevgep"); in expandIVInc()
861 Builder.CreateSub(PN, StepV, Twine(IVName) + ".iv.next") : in expandIVInc()
862 Builder.CreateAdd(PN, StepV, Twine(IVName) + ".iv.next"); in expandIVInc()
954 for (PHINode &PN : L->getHeader()->phis()) { in getAddRecExprPHILiterally()
955 if (!SE.isSCEVable(PN.getType())) in getAddRecExprPHILiterally()
960 if (!PN.isComplete()) { in getAddRecExprPHILiterally()
962 DebugType, dbgs() << "One incomplete PHI is found: " << PN << "\n"); in getAddRecExprPHILiterally()
966 const SCEVAddRecExpr *PhiSCEV = dyn_cast<SCEVAddRecExpr>(SE.getSCEV(&PN)); in getAddRecExprPHILiterally()
979 dyn_cast<Instruction>(PN.getIncomingValueForBlock(LatchBlock)); in getAddRecExprPHILiterally()
985 if (!isExpandedAddRecExprPHI(&PN, TempIncV, L)) in getAddRecExprPHILiterally()
988 if (!isNormalAddRecExprPHI(&PN, TempIncV, L)) in getAddRecExprPHILiterally()
997 AddRecPhiMatch = &PN; in getAddRecExprPHILiterally()
1007 AddRecPhiMatch = &PN; in getAddRecExprPHILiterally()
1073 PHINode *PN = in getAddRecExprPHILiterally() local
1080 PN->addIncoming(StartV, Pred); in getAddRecExprPHILiterally()
1090 Value *IncV = expandIVInc(PN, StepV, L, useSubtract); in getAddRecExprPHILiterally()
1098 PN->addIncoming(IncV, Pred); in getAddRecExprPHILiterally()
1107 InsertedValues.insert(PN); in getAddRecExprPHILiterally()
1108 InsertedIVs.push_back(PN); in getAddRecExprPHILiterally()
1109 return PN; in getAddRecExprPHILiterally()
1135 PHINode *PN = getAddRecExprPHILiterally(Normalized, L, TruncTy, InvertStep); in expandAddRecExprLiterally() local
1140 Result = PN; in expandAddRecExprLiterally()
1145 Result = PN->getIncomingValueForBlock(LatchBlock); in expandAddRecExprLiterally()
1183 Result = expandIVInc(PN, StepV, L, useSubtract); in expandAddRecExprLiterally()
1221 if (PHINode *PN = L->getCanonicalInductionVariable()) in visitAddRecExpr() local
1222 if (SE.getTypeSizeInBits(PN->getType()) >= SE.getTypeSizeInBits(Ty)) in visitAddRecExpr()
1223 CanonicalIV = PN; in visitAddRecExpr()
1654 if (PHINode *PN = dyn_cast<PHINode>(OrigInc)) in replaceCongruentIVInc() local
1655 IP = PN->getParent()->getFirstInsertionPt(); in replaceCongruentIVInc()
1680 for (PHINode &PN : L->getHeader()->phis()) in replaceCongruentIVs()
1681 Phis.push_back(&PN); in replaceCongruentIVs()
1699 auto SimplifyPHINode = [&](PHINode *PN) -> Value * { in replaceCongruentIVs() argument
1700 if (Value *V = simplifyInstruction(PN, {DL, &SE.TLI, &SE.DT, &SE.AC})) in replaceCongruentIVs()
1702 if (!SE.isSCEVable(PN->getType())) in replaceCongruentIVs()
1704 auto *Const = dyn_cast<SCEVConstant>(SE.getSCEV(PN)); in replaceCongruentIVs()
2282 for (PHINode *PN : InsertedPHIs) in fixupLCSSAFormFor()
2283 rememberInstruction(PN); in fixupLCSSAFormFor()
2284 for (PHINode *PN : PHIsToRemove) { in fixupLCSSAFormFor()
2285 if (!PN->use_empty()) in fixupLCSSAFormFor()
2287 InsertedValues.erase(PN); in fixupLCSSAFormFor()
2288 InsertedPostIncValues.erase(PN); in fixupLCSSAFormFor()
2289 PN->eraseFromParent(); in fixupLCSSAFormFor()