Home
last modified time | relevance | path

Searched refs:PN (Results 1 – 25 of 188) sorted by relevance

12345678

/freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/
H A DInstCombinePHI.cpp43 void InstCombinerImpl::PHIArgMergedDebugLoc(Instruction *Inst, PHINode &PN) { in PHIArgMergedDebugLoc() argument
44 auto *FirstInst = cast<Instruction>(PN.getIncomingValue(0)); in PHIArgMergedDebugLoc()
50 for (Value *V : drop_begin(PN.incoming_values())) { in PHIArgMergedDebugLoc()
106 bool InstCombinerImpl::foldIntegerTypedPHI(PHINode &PN) { in foldIntegerTypedPHI() argument
107 if (!PN.getType()->isIntegerTy()) in foldIntegerTypedPHI()
109 if (!PN.hasOneUse()) in foldIntegerTypedPHI()
112 auto *IntToPtr = dyn_cast<IntToPtrInst>(PN.user_back()); in foldIntegerTypedPHI()
142 for (auto Incoming : zip(PN.blocks(), PN.incoming_values())) { in foldIntegerTypedPHI()
190 auto *BB = PN.getParent(); in foldIntegerTypedPHI()
191 assert(AvailablePtrVals.size() == PN.getNumIncomingValues() && in foldIntegerTypedPHI()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/
H A DLoopSimplify.cpp177 PHINode *PN = cast<PHINode>(I); in findPHIToPartitionLoops() local
179 if (Value *V = simplifyInstruction(PN, {DL, nullptr, DT, AC})) { in findPHIToPartitionLoops()
181 PN->replaceAllUsesWith(V); in findPHIToPartitionLoops()
182 PN->eraseFromParent(); in findPHIToPartitionLoops()
187 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in findPHIToPartitionLoops()
188 if (PN->getIncomingValue(i) == PN && in findPHIToPartitionLoops()
189 L->contains(PN->getIncomingBlock(i))) in findPHIToPartitionLoops()
191 return PN; in findPHIToPartitionLoops()
248 PHINode *PN = findPHIToPartitionLoops(L, DT, AC); in separateNestedLoop() local
249 if (!PN) return nullptr; // No known way to partition. in separateNestedLoop()
[all …]
H A DLCSSA.cpp121 if (auto *PN = dyn_cast<PHINode>(User)) in formLCSSAForInstructions() local
122 UserBB = PN->getIncomingBlock(U); in formLCSSAForInstructions()
162 PHINode *PN = PHINode::Create(I->getType(), PredCache.size(ExitBB), in formLCSSAForInstructions() local
164 PN->insertBefore(ExitBB->begin()); in formLCSSAForInstructions()
166 InsertedPHIs->push_back(PN); in formLCSSAForInstructions()
168 PN->setDebugLoc(I->getDebugLoc()); in formLCSSAForInstructions()
176 PN->addIncoming(I, Pred); in formLCSSAForInstructions()
183 &PN->getOperandUse(PN->getOperandNumForIncomingValue( in formLCSSAForInstructions()
184 PN->getNumIncomingValues() - 1))); in formLCSSAForInstructions()
187 AddedPHIs.push_back(PN); in formLCSSAForInstructions()
[all …]
H A DLoopVersioning.cpp133 PHINode *PN; in addPHINodes() local
140 for (auto I = PHIBlock->begin(); (PN = dyn_cast<PHINode>(I)); ++I) { in addPHINodes()
141 if (PN->getIncomingValue(0) == Inst) { in addPHINodes()
142 SE->forgetValue(PN); in addPHINodes()
147 if (!PN) { in addPHINodes()
148 PN = PHINode::Create(Inst->getType(), 2, Inst->getName() + ".lver"); in addPHINodes()
149 PN->insertBefore(PHIBlock->begin()); in addPHINodes()
155 U->replaceUsesOfWith(Inst, PN); in addPHINodes()
156 PN->addIncoming(Inst, VersionedLoop->getExitingBlock()); in addPHINodes()
161 for (auto I = PHIBlock->begin(); (PN = dyn_cast<PHINode>(I)); ++I) { in addPHINodes()
[all …]
H A DLoopUnrollRuntime.cpp111 for (PHINode &PN : Succ->phis()) { in ConnectProlog()
119 PHINode *NewPN = PHINode::Create(PN.getType(), 2, PN.getName() + ".unr"); in ConnectProlog()
123 if (L->contains(&PN)) { in ConnectProlog()
125 NewPN->addIncoming(PN.getIncomingValueForBlock(NewPreHeader), in ConnectProlog()
129 NewPN->addIncoming(PoisonValue::get(PN.getType()), PreHeader); in ConnectProlog()
132 Value *V = PN.getIncomingValueForBlock(Latch); in ConnectProlog()
145 if (L->contains(&PN)) in ConnectProlog()
146 PN.setIncomingValueForBlock(NewPreHeader, NewPN); in ConnectProlog()
148 PN.addIncoming(NewPN, PrologExit); in ConnectProlog()
149 SE.forgetValue(&PN); in ConnectProlog()
[all …]
H A DUnifyFunctionExitNodes.cpp62 PHINode *PN = nullptr; in unifyUnreachableBlocks()
67 PN = PHINode::Create(F.getReturnType(), ReturningBlocks.size(), in unifyUnreachableBlocks()
69 PN->insertInto(NewRetBlock, NewRetBlock->end());
70 ReturnInst::Create(F.getContext(), PN, NewRetBlock); in unifyReturnBlocks()
78 if (PN) in unifyReturnBlocks()
79 PN->addIncoming(BB->getTerminator()->getOperand(0), BB); in unifyReturnBlocks()
86 PHINode *PN = nullptr; unifyReturnBlocks() local
H A DSSAUpdaterBulk.cpp154 PHINode *PN = B.CreatePHI(R.Ty, 0, R.Name); in RewriteAllUses() local
155 R.Defines[FrontierBB] = PN; in RewriteAllUses()
156 InsertedPHIsForVar.push_back(PN); in RewriteAllUses()
158 InsertedPHIs->push_back(PN); in RewriteAllUses()
162 for (auto *PN : InsertedPHIsForVar) { in RewriteAllUses() local
163 BasicBlock *PBB = PN->getParent(); in RewriteAllUses()
165 PN->addIncoming(computeValueAt(Pred, R, DT), Pred); in RewriteAllUses()
H A DBasicBlockUtils.cpp150 while (PHINode *PN = dyn_cast<PHINode>(BB->begin())) { in FoldSingleEntryPHINodes() local
151 if (PN->getIncomingValue(0) != PN) in FoldSingleEntryPHINodes()
152 PN->replaceAllUsesWith(PN->getIncomingValue(0)); in FoldSingleEntryPHINodes()
154 PN->replaceAllUsesWith(PoisonValue::get(PN->getType())); in FoldSingleEntryPHINodes()
157 MemDep->removeInstruction(PN); // Memdep updates AA itself. in FoldSingleEntryPHINodes()
159 PN->eraseFromParent(); in FoldSingleEntryPHINodes()
169 for (PHINode &PN : BB->phis()) in DeleteDeadPHIs()
170 PHIs.push_back(&PN); in DeleteDeadPHIs()
174 if (PHINode *PN = dyn_cast_or_null<PHINode>(PHIs[i].operator Value*())) in DeleteDeadPHIs() local
175 Changed |= RecursivelyDeleteDeadPHINode(PN, TLI, MSSAU); in DeleteDeadPHIs()
[all …]
H A DScalarEvolutionExpander.cpp674 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()
[all …]
H A DCloneFunction.cpp714 for (const PHINode &PN : BI.phis()) { in CloneAndPruneIntoFromInst() local
717 if (isa<PHINode>(VMap[&PN])) in CloneAndPruneIntoFromInst()
718 PHIToResolve.push_back(&PN); in CloneAndPruneIntoFromInst()
744 PHINode *PN = cast<PHINode>(VMap[OPN]); in CloneAndPruneIntoFromInst() local
746 Value *V = VMap.lookup(PN->getIncomingBlock(pred)); in CloneAndPruneIntoFromInst()
749 MapValue(PN->getIncomingValue(pred), VMap, in CloneAndPruneIntoFromInst()
752 PN->setIncomingValue(pred, InVal); in CloneAndPruneIntoFromInst()
753 PN->setIncomingBlock(pred, MappedBlock); in CloneAndPruneIntoFromInst()
755 PN->removeIncomingValue(pred, false); in CloneAndPruneIntoFromInst()
767 PHINode *PN = cast<PHINode>(NewBB->begin()); in CloneAndPruneIntoFromInst() local
[all …]
H A DDemoteRegToStack.cpp68 if (PHINode *PN = dyn_cast<PHINode>(U)) { in DemoteRegToStack() local
79 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in DemoteRegToStack()
80 if (PN->getIncomingValue(i) == &I) { in DemoteRegToStack()
81 Value *&V = Loads[PN->getIncomingBlock(i)]; in DemoteRegToStack()
86 PN->getIncomingBlock(i)->getTerminator()->getIterator()); in DemoteRegToStack()
87 Loads[PN->getIncomingBlock(i)] = V; in DemoteRegToStack()
89 PN->setIncomingValue(i, V); in DemoteRegToStack()
H A DCodeExtractor.cpp675 PHINode *PN = dyn_cast<PHINode>(Header->begin()); in severSplitPHINodesOfEntry() local
676 if (!PN) return; // No PHI nodes. in severSplitPHINodesOfEntry()
681 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in severSplitPHINodesOfEntry()
682 if (Blocks.count(PN->getIncomingBlock(i))) in severSplitPHINodesOfEntry()
708 PHINode *PN = cast<PHINode>(OldPred->begin()); in severSplitPHINodesOfEntry() local
711 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in severSplitPHINodesOfEntry()
712 if (Blocks.count(PN->getIncomingBlock(i))) { in severSplitPHINodesOfEntry()
713 Instruction *TI = PN->getIncomingBlock(i)->getTerminator(); in severSplitPHINodesOfEntry()
721 PHINode *PN = cast<PHINode>(AfterPHIs); in severSplitPHINodesOfEntry() local
724 PHINode *NewPN = PHINode::Create(PN->getType(), 1 + NumPredsFromRegion, in severSplitPHINodesOfEntry()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/
H A DLoopBoundSplit.cpp74 PHINode *PN = cast<PHINode>(Cond.AddRecValue); in analyzeICmp() local
75 Cond.NonPHIAddRecValue = PN->getIncomingValueForBlock(L.getLoopLatch()); in analyzeICmp()
365 for (PHINode &PN : L.getHeader()->phis()) { in splitLoopBound()
368 Builder.CreatePHI(PN.getType(), 1, PN.getName() + ".lcssa"); in splitLoopBound()
369 LCSSAPhi->setDebugLoc(PN.getDebugLoc()); in splitLoopBound()
373 isExitingLatch ? PN.getIncomingValueForBlock(L.getLoopLatch()) : &PN, in splitLoopBound()
377 PHINode *PostLoopPN = cast<PHINode>(VMap[&PN]); in splitLoopBound()
383 if (!SE.isSCEVable(PN.getType())) in splitLoopBound()
386 const SCEVAddRecExpr *PhiSCEV = dyn_cast<SCEVAddRecExpr>(SE.getSCEV(&PN)); in splitLoopBound()
388 PN.getIncomingValueForBlock(L.getLoopLatch())) in splitLoopBound()
[all …]
H A DGVNSink.cpp229 ModelledPHI(const PHINode *PN, in ModelledPHI() argument
236 for (unsigned I = 0, E = PN->getNumIncomingValues(); I != E; ++I) in ModelledPHI()
237 Ops.push_back({PN->getIncomingBlock(I), PN->getIncomingValue(I)}); in ModelledPHI()
649 for (PHINode &PN : BB->phis()) { in analyzeInitialPHIs()
650 auto MPHI = ModelledPHI(&PN, RPOTOrder); in analyzeInitialPHIs()
668 while (PHINode *PN = dyn_cast<PHINode>(I++)) { in foldPointlessPHINodes() local
669 if (!llvm::all_of(PN->incoming_values(), [&](const Value *V) { in foldPointlessPHINodes()
670 return V == PN->getIncomingValue(0); in foldPointlessPHINodes()
673 if (PN->getIncomingValue(0) != PN) in foldPointlessPHINodes()
674 PN->replaceAllUsesWith(PN->getIncomingValue(0)); in foldPointlessPHINodes()
[all …]
H A DCallSiteSplitting.cpp336 for (PHINode &PN : TailBB->phis()) { in splitCallSite()
339 if (&*CI == &PN) { in splitCallSite()
340 NewCI->setArgOperand(ArgNo, PN.getIncomingValueForBlock(SplitBlock)); in splitCallSite()
421 for (auto &PN : Parent->phis()) { in isPredicatedOnPHI() local
423 if (&*Arg != &PN) in isPredicatedOnPHI()
425 assert(PN.getNumIncomingValues() == 2 && in isPredicatedOnPHI()
427 if (PN.getIncomingBlock(0) == PN.getIncomingBlock(1)) in isPredicatedOnPHI()
429 if (PN.getIncomingValue(0) == PN.getIncomingValue(1)) in isPredicatedOnPHI()
431 if (isa<Constant>(PN.getIncomingValue(0)) && in isPredicatedOnPHI()
432 isa<Constant>(PN.getIncomingValue(1))) in isPredicatedOnPHI()
H A DIndVarSimplify.cpp207 bool IndVarSimplify::handleFloatingPointIV(Loop *L, PHINode *PN) { in handleFloatingPointIV() argument
208 unsigned IncomingEdge = L->contains(PN->getIncomingBlock(0)); in handleFloatingPointIV()
212 auto *InitValueVal = dyn_cast<ConstantFP>(PN->getIncomingValue(IncomingEdge)); in handleFloatingPointIV()
220 auto *Incr = dyn_cast<BinaryOperator>(PN->getIncomingValue(BackEdge)); in handleFloatingPointIV()
227 if (IncValueVal == nullptr || Incr->getOperand(0) != PN || in handleFloatingPointIV()
355 IntegerType *Int32Ty = Type::getInt32Ty(PN->getContext()); in handleFloatingPointIV()
359 PHINode::Create(Int32Ty, 2, PN->getName() + ".int", PN->getIterator()); in handleFloatingPointIV()
361 PN->getIncomingBlock(IncomingEdge)); in handleFloatingPointIV()
362 NewPHI->setDebugLoc(PN->getDebugLoc()); in handleFloatingPointIV()
368 NewPHI->addIncoming(NewAdd, PN->getIncomingBlock(BackEdge)); in handleFloatingPointIV()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Analysis/
H A DPhiValues.cpp125 const PhiValues::ValueSet &PhiValues::getValuesForPhi(const PHINode *PN) { in getValuesForPhi() argument
126 unsigned int DepthNumber = DepthMap.lookup(PN); in getValuesForPhi()
129 processPhi(PN, Stack); in getValuesForPhi()
130 DepthNumber = DepthMap.lookup(PN); in getValuesForPhi()
146 if (const PHINode *PN = dyn_cast<PHINode>(V)) in invalidateValue() local
147 DepthMap.erase(PN); in invalidateValue()
167 for (const PHINode &PN : BB.phis()) { in print() local
169 PN.printAsOperand(OS, false); in print()
171 unsigned int N = DepthMap.lookup(&PN); in print()
200 for (const PHINode &PN : BB.phis()) in run() local
[all …]
/freebsd/contrib/llvm-project/llvm/lib/IR/
H A DDominators.cpp124 if (auto *PN = dyn_cast<PHINode>(UserInst)) in dominates() local
127 return dominates(BB, PN->getIncomingBlock(U)); in dominates()
253 PHINode *PN = dyn_cast<PHINode>(UserInst); in dominates() local
254 if (PN && PN->getParent() == BBE.getEnd() && in dominates()
255 PN->getIncomingBlock(U) == BBE.getStart()) in dominates()
261 if (PN) in dominates()
262 UseBB = PN->getIncomingBlock(U); in dominates()
283 if (PHINode *PN = dyn_cast<PHINode>(UserInst)) in dominates() local
284 UseBB = PN in dominates()
329 if (PHINode *PN = dyn_cast<PHINode>(I)) isReachableFromEntry() local
[all...]
H A DSafepointIRVerifier.cpp83 bool hasLiveIncomingEdge(const PHINode *PN, const BasicBlock *InBB) const { in hasLiveIncomingEdge() argument
85 const BasicBlock* BB = PN->getParent(); in hasLiveIncomingEdge()
350 if (const auto *PN = dyn_cast<PHINode>(V)) { in getBaseType() local
351 append_range(Worklist, PN->incoming_values()); in getBaseType()
469 bool hasLiveIncomingEdge(const PHINode *PN, const BasicBlock *InBB) const { in hasLiveIncomingEdge() argument
470 return CD.hasLiveIncomingEdge(PN, InBB); in hasLiveIncomingEdge()
665 if (const PHINode *PN = dyn_cast<PHINode>(&I)) { in removeValidUnrelocatedDefs() local
666 if (containsGCPtrType(PN->getType())) { in removeValidUnrelocatedDefs()
670 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { in removeValidUnrelocatedDefs()
671 const BasicBlock *InBB = PN->getIncomingBlock(i); in removeValidUnrelocatedDefs()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/Hexagon/
H A DHexagonVectorLoopCarriedReuse.cpp381 PHINode *PN = cast<PHINode>(D->front()); in findValueToReuse() local
384 BasicBlock *BB = PN->getParent(); in findValueToReuse()
385 LLVM_DEBUG(dbgs() << "Checking if any uses of " << *PN in findValueToReuse()
389 for (Use &U : PN->uses()) { in findValueToReuse()
410 // For each interesting use I of PN, find an Instruction BEUser that in findValueToReuse()
514 PHINode *PN = dyn_cast<PHINode>(Op); in findValueInBlock() local
515 assert(PN); in findValueInBlock()
516 Value *ValueInBlock = PN->getIncomingValueForBlock(BB); in findValueInBlock()
603 PHINode *PN = dyn_cast<PHINode>(I); in findDepChainFromPHI() local
604 if (!PN) { in findDepChainFromPHI()
650 auto *PN = cast<PHINode>(I); findLoopCarriedDeps() local
[all...]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/ObjCARC/
H A DObjCARC.h74 void getEquivalentPHIs(PHINodeTy &PN, VectorTy &PHIList) { in getEquivalentPHIs() argument
75 auto *BB = PN.getParent(); in getEquivalentPHIs()
77 if (&P == &PN) // Do not add PN to the list. in getEquivalentPHIs()
79 unsigned I = 0, E = PN.getNumIncomingValues(); in getEquivalentPHIs()
81 auto *BB = PN.getIncomingBlock(I); in getEquivalentPHIs()
82 auto *PNOpnd = PN.getIncomingValue(I)->stripPointerCasts(); in getEquivalentPHIs()
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/
H A DWinEHPrepare.cpp75 AllocaInst *insertPHILoads(PHINode *PN, Function &F);
870 auto *PN = dyn_cast<PHINode>(&I); in demotePHIsOnFunclets() local
872 if (!PN) in demotePHIsOnFunclets()
875 AllocaInst *SpillSlot = insertPHILoads(PN, F); in demotePHIsOnFunclets()
877 insertPHIStores(PN, SpillSlot); in demotePHIsOnFunclets()
879 PHINodes.push_back(PN); in demotePHIsOnFunclets()
883 for (auto *PN : PHINodes) { in demotePHIsOnFunclets() local
885 PN->replaceAllUsesWith(PoisonValue::get(PN->getType())); in demotePHIsOnFunclets()
886 PN->eraseFromParent(); in demotePHIsOnFunclets()
986 auto UpdatePHIOnClonedBlock = [&](PHINode *PN, bool IsForOldBlock) { in cloneCommonBlocks() argument
[all …]
/freebsd/contrib/llvm-project/llvm/include/llvm/Analysis/
H A DSparsePropagation.h78 virtual bool IsSpecialCasedPHI(PHINode *PN) { return false; } in IsSpecialCasedPHI() argument
399 void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::visitPHINode(PHINode &PN) { in visitPHINode() argument
403 if (LatticeFunc->IsSpecialCasedPHI(&PN)) { in visitPHINode()
405 LatticeFunc->ComputeInstructionState(PN, ChangedValues, *this); in visitPHINode()
413 LatticeKey Key = KeyInfo::getLatticeKeyFromValue(&PN); in visitPHINode()
423 if (PN.getNumIncomingValues() > 64) { in visitPHINode()
431 for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) { in visitPHINode()
433 if (!isEdgeFeasible(PN.getIncomingBlock(i), PN.getParent(), true)) in visitPHINode()
438 getValueState(KeyInfo::getLatticeKeyFromValue(PN.getIncomingValue(i))); in visitPHINode()
454 if (PHINode *PN = dyn_cast<PHINode>(&I)) in visitInst() local
[all …]
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/
H A DFunctionLoweringInfo.cpp279 for (const PHINode &PN : BB.phis()) { in set() local
280 if (PN.use_empty()) in set()
284 if (PN.getType()->isEmptyTy()) in set()
287 DebugLoc DL = PN.getDebugLoc(); in set()
288 unsigned PHIReg = ValueMap[&PN]; in set()
292 ComputeValueVTs(*TLI, MF->getDataLayout(), PN.getType(), ValueVTs); in set()
438 void FunctionLoweringInfo::ComputePHILiveOutRegInfo(const PHINode *PN) { in ComputePHILiveOutRegInfo() argument
439 Type *Ty = PN->getType(); in ComputePHILiveOutRegInfo()
449 if (TLI->getNumRegisters(PN->getContext(), IntVT) != 1) in ComputePHILiveOutRegInfo()
451 IntVT = TLI->getRegisterType(PN->getContext(), IntVT); in ComputePHILiveOutRegInfo()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/XCore/
H A DXCoreLowerThreadLocal.cpp85 if (PHINode *PN = dyn_cast<PHINode>(WU)) { in replaceConstantExprOp() local
86 for (int I = 0, E = PN->getNumIncomingValues(); I < E; ++I) in replaceConstantExprOp()
87 if (PN->getIncomingValue(I) == CE) { in replaceConstantExprOp()
88 BasicBlock *PredBB = PN->getIncomingBlock(I); in replaceConstantExprOp()
90 PredBB = SplitEdge(PredBB, PN->getParent()); in replaceConstantExprOp()
95 PN->setOperand(I, NewInst); in replaceConstantExprOp()

12345678