/external/llvm/lib/Transforms/InstCombine/ |
D | InstCombinePHI.cpp | 25 Instruction *InstCombiner::FoldPHIArgBinOpIntoPHI(PHINode &PN) { in FoldPHIArgBinOpIntoPHI() argument 26 Instruction *FirstInst = cast<Instruction>(PN.getIncomingValue(0)); in FoldPHIArgBinOpIntoPHI() 45 for (unsigned i = 1; i != PN.getNumIncomingValues(); ++i) { in FoldPHIArgBinOpIntoPHI() 46 Instruction *I = dyn_cast<Instruction>(PN.getIncomingValue(i)); in FoldPHIArgBinOpIntoPHI() 84 NewLHS = PHINode::Create(LHSType, PN.getNumIncomingValues(), in FoldPHIArgBinOpIntoPHI() 86 NewLHS->addIncoming(InLHS, PN.getIncomingBlock(0)); in FoldPHIArgBinOpIntoPHI() 87 InsertNewInstBefore(NewLHS, PN); in FoldPHIArgBinOpIntoPHI() 92 NewRHS = PHINode::Create(RHSType, PN.getNumIncomingValues(), in FoldPHIArgBinOpIntoPHI() 94 NewRHS->addIncoming(InRHS, PN.getIncomingBlock(0)); in FoldPHIArgBinOpIntoPHI() 95 InsertNewInstBefore(NewRHS, PN); in FoldPHIArgBinOpIntoPHI() [all …]
|
/external/llvm/lib/IR/ |
D | BasicBlock.cpp | 295 while (PHINode *PN = dyn_cast<PHINode>(&front())) { in removePredecessor() local 297 PN->removeIncomingValue(Pred, !DontDeleteUselessPHIs); in removePredecessor() 301 if (PN->getIncomingValue(0) != PN) in removePredecessor() 302 PN->replaceAllUsesWith(PN->getIncomingValue(0)); in removePredecessor() 305 PN->replaceAllUsesWith(UndefValue::get(PN->getType())); in removePredecessor() 315 PHINode *PN; in removePredecessor() local 316 for (iterator II = begin(); (PN = dyn_cast<PHINode>(II)); ) { in removePredecessor() 318 PN->removeIncomingValue(Pred, false); in removePredecessor() 322 if (!DontDeleteUselessPHIs && (PNV = PN->hasConstantValue())) in removePredecessor() 323 if (PNV != PN) { in removePredecessor() [all …]
|
D | Dominators.cpp | 203 PHINode *PN = dyn_cast<PHINode>(UserInst); in dominates() local 204 if (PN && PN->getParent() == BBE.getEnd() && in dominates() 205 PN->getIncomingBlock(U) == BBE.getStart()) in dominates() 211 if (PN) in dominates() 212 UseBB = PN->getIncomingBlock(U); in dominates() 226 if (PHINode *PN = dyn_cast<PHINode>(UserInst)) in dominates() local 227 UseBB = PN->getIncomingBlock(U); in dominates() 277 if (PHINode *PN = dyn_cast<PHINode>(I)) in isReachableFromEntry() local 278 return isReachableFromEntry(PN->getIncomingBlock(U)); in isReachableFromEntry()
|
/external/llvm/lib/Transforms/Utils/ |
D | BasicBlockUtils.cpp | 72 while (PHINode *PN = dyn_cast<PHINode>(BB->begin())) { in FoldSingleEntryPHINodes() local 73 if (PN->getIncomingValue(0) != PN) in FoldSingleEntryPHINodes() 74 PN->replaceAllUsesWith(PN->getIncomingValue(0)); in FoldSingleEntryPHINodes() 76 PN->replaceAllUsesWith(UndefValue::get(PN->getType())); in FoldSingleEntryPHINodes() 79 MemDep->removeInstruction(PN); // Memdep updates AA itself. in FoldSingleEntryPHINodes() 80 else if (AA && isa<PointerType>(PN->getType())) in FoldSingleEntryPHINodes() 81 AA->deleteValue(PN); in FoldSingleEntryPHINodes() 83 PN->eraseFromParent(); in FoldSingleEntryPHINodes() 97 PHINode *PN = dyn_cast<PHINode>(I); ++I) in DeleteDeadPHIs() 98 PHIs.push_back(PN); in DeleteDeadPHIs() [all …]
|
D | LoopSimplify.cpp | 216 PHINode *PN = cast<PHINode>(I); in findPHIToPartitionLoops() local 218 if (Value *V = SimplifyInstruction(PN, DL, nullptr, DT, AC)) { in findPHIToPartitionLoops() 220 PN->replaceAllUsesWith(V); in findPHIToPartitionLoops() 221 if (AA) AA->deleteValue(PN); in findPHIToPartitionLoops() 222 PN->eraseFromParent(); in findPHIToPartitionLoops() 227 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in findPHIToPartitionLoops() 228 if (PN->getIncomingValue(i) == PN && in findPHIToPartitionLoops() 229 L->contains(PN->getIncomingBlock(i))) in findPHIToPartitionLoops() 231 return PN; in findPHIToPartitionLoops() 267 PHINode *PN = findPHIToPartitionLoops(L, AA, DT, AC); in separateNestedLoop() local [all …]
|
D | Local.cpp | 395 bool llvm::RecursivelyDeleteDeadPHINode(PHINode *PN, in RecursivelyDeleteDeadPHINode() argument 398 for (Instruction *I = PN; areAllUsesEqual(I) && !I->mayHaveSideEffects(); in RecursivelyDeleteDeadPHINode() 478 while (PHINode *PN = dyn_cast<PHINode>(PhiIt)) { in RemovePredecessorAndSimplify() local 482 if (!recursivelySimplifyInstruction(PN)) in RemovePredecessorAndSimplify() 500 while (PHINode *PN = dyn_cast<PHINode>(DestBB->begin())) { in MergeBasicBlockIntoOnlyPred() local 501 Value *NewVal = PN->getIncomingValue(0); in MergeBasicBlockIntoOnlyPred() 503 if (NewVal == PN) NewVal = UndefValue::get(PN->getType()); in MergeBasicBlockIntoOnlyPred() 504 PN->replaceAllUsesWith(NewVal); in MergeBasicBlockIntoOnlyPred() 505 PN->eraseFromParent(); in MergeBasicBlockIntoOnlyPred() 570 PHINode *PN = cast<PHINode>(I); in CanPropagatePredecessorsForPHIs() local [all …]
|
D | BreakCriticalEdges.cpp | 93 PHINode *PN = dyn_cast<PHINode>(I); ++I) { in createPHIsForSplitLoopExit() 94 unsigned Idx = PN->getBasicBlockIndex(SplitBB); in createPHIsForSplitLoopExit() 95 Value *V = PN->getIncomingValue(Idx); in createPHIsForSplitLoopExit() 105 PHINode::Create(PN->getType(), Preds.size(), "split", in createPHIsForSplitLoopExit() 112 PN->setIncomingValue(Idx, NewPN); in createPHIsForSplitLoopExit() 171 PHINode *PN = cast<PHINode>(I); in SplitCriticalEdge() local 178 if (PN->getIncomingBlock(BBIdx) != TIBB) in SplitCriticalEdge() 179 BBIdx = PN->getBasicBlockIndex(TIBB); in SplitCriticalEdge() 180 PN->setIncomingBlock(BBIdx, NewBB); in SplitCriticalEdge() 215 if (PHINode *PN = dyn_cast<PHINode>(DestBB->begin())) { in SplitCriticalEdge() local [all …]
|
D | CloneFunction.cpp | 531 if (const PHINode *PN = dyn_cast<PHINode>(I)) { in CloneAndPruneIntoFromInst() local 532 if (isa<PHINode>(VMap[PN])) in CloneAndPruneIntoFromInst() 533 PHIToResolve.push_back(PN); in CloneAndPruneIntoFromInst() 561 PHINode *PN = cast<PHINode>(VMap[OPN]); in CloneAndPruneIntoFromInst() local 563 Value *V = VMap[PN->getIncomingBlock(pred)]; in CloneAndPruneIntoFromInst() 565 Value *InVal = MapValue(PN->getIncomingValue(pred), in CloneAndPruneIntoFromInst() 569 PN->setIncomingValue(pred, InVal); in CloneAndPruneIntoFromInst() 570 PN->setIncomingBlock(pred, MappedBlock); in CloneAndPruneIntoFromInst() 572 PN->removeIncomingValue(pred, false); in CloneAndPruneIntoFromInst() 583 PHINode *PN = cast<PHINode>(NewBB->begin()); in CloneAndPruneIntoFromInst() local [all …]
|
D | LCSSA.cpp | 72 if (PHINode *PN = dyn_cast<PHINode>(User)) in processInstruction() local 73 UserBB = PN->getIncomingBlock(U); in processInstruction() 115 PHINode *PN = PHINode::Create(Inst.getType(), PredCache.GetNumPreds(ExitBB), in processInstruction() local 120 PN->addIncoming(&Inst, *PI); in processInstruction() 127 &PN->getOperandUse(PN->getOperandNumForIncomingValue( in processInstruction() 128 PN->getNumIncomingValues() - 1))); in processInstruction() 131 AddedPHIs.push_back(PN); in processInstruction() 134 SSAUpdate.AddAvailableValue(ExitBB, PN); in processInstruction() 146 PostProcessPHIs.push_back(PN); in processInstruction() 158 if (PHINode *PN = dyn_cast<PHINode>(User)) in processInstruction() local [all …]
|
D | CodeExtractor.cpp | 193 PHINode *PN = dyn_cast<PHINode>(Header->begin()); in severSplitPHINodes() local 194 if (!PN) return; // No PHI nodes. in severSplitPHINodes() 199 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in severSplitPHINodes() 200 if (Blocks.count(PN->getIncomingBlock(i))) in severSplitPHINodes() 233 PHINode *PN = cast<PHINode>(OldPred->begin()); in severSplitPHINodes() local 236 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in severSplitPHINodes() 237 if (Blocks.count(PN->getIncomingBlock(i))) { in severSplitPHINodes() 238 TerminatorInst *TI = PN->getIncomingBlock(i)->getTerminator(); in severSplitPHINodes() 245 PHINode *PN = cast<PHINode>(AfterPHIs); in severSplitPHINodes() local 248 PHINode *NewPN = PHINode::Create(PN->getType(), 1 + NumPredsFromRegion, in severSplitPHINodes() [all …]
|
D | UnifyFunctionExitNodes.cpp | 93 PHINode *PN = nullptr; in runOnFunction() local 98 PN = PHINode::Create(F.getReturnType(), ReturningBlocks.size(), in runOnFunction() 100 NewRetBlock->getInstList().push_back(PN); in runOnFunction() 101 ReturnInst::Create(F.getContext(), PN, NewRetBlock); in runOnFunction() 113 if (PN) in runOnFunction() 114 PN->addIncoming(BB->getTerminator()->getOperand(0), BB); in runOnFunction()
|
D | DemoteRegToStack.cpp | 58 if (PHINode *PN = dyn_cast<PHINode>(U)) { in DemoteRegToStack() local 69 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in DemoteRegToStack() 70 if (PN->getIncomingValue(i) == &I) { in DemoteRegToStack() 71 Value *&V = Loads[PN->getIncomingBlock(i)]; in DemoteRegToStack() 75 PN->getIncomingBlock(i)->getTerminator()); in DemoteRegToStack() 77 PN->setIncomingValue(i, V); in DemoteRegToStack()
|
D | LoopUnrollRuntime.cpp | 78 PHINode *PN = dyn_cast<PHINode>(BBI); ++BBI) { in ConnectProlog() 82 PHINode *NewPN = PHINode::Create(PN->getType(), 2, PN->getName()+".unr", in ConnectProlog() 86 if (L->contains(PN)) { in ConnectProlog() 87 NewPN->addIncoming(PN->getIncomingValueForBlock(NewPH), OrigPH); in ConnectProlog() 89 NewPN->addIncoming(Constant::getNullValue(PN->getType()), OrigPH); in ConnectProlog() 92 Value *V = PN->getIncomingValueForBlock(Latch); in ConnectProlog() 105 if (L->contains(PN)) { in ConnectProlog() 106 PN->setIncomingValue(PN->getBasicBlockIndex(NewPH), NewPN); in ConnectProlog() 108 PN->addIncoming(NewPN, PrologEnd); in ConnectProlog()
|
D | SimplifyCFG.cpp | 158 PHINode *PN = cast<PHINode>(BBI); in SafeToMergeTerminators() local 159 if (PN->getIncomingValueForBlock(SI1BB) != in SafeToMergeTerminators() 160 PN->getIncomingValueForBlock(SI2BB)) in SafeToMergeTerminators() 199 PHINode *PN = cast<PHINode>(BBI); in isProfitableToFoldUnconditional() local 200 if (PN->getIncomingValueForBlock(SI1BB) != Cond || in isProfitableToFoldUnconditional() 201 !isa<ConstantInt>(PN->getIncomingValueForBlock(SI2BB))) in isProfitableToFoldUnconditional() 203 PhiNodes.push_back(PN); in isProfitableToFoldUnconditional() 216 PHINode *PN; in AddPredecessorToBlock() local 218 (PN = dyn_cast<PHINode>(I)); ++I) in AddPredecessorToBlock() 219 PN->addIncoming(PN->getIncomingValueForBlock(ExistPred), NewPred); in AddPredecessorToBlock() [all …]
|
D | LowerSwitch.cpp | 164 PHINode *PN = cast<PHINode>(I); in fixPhis() local 167 unsigned Idx = 0, E = PN->getNumIncomingValues(); in fixPhis() 170 if (PN->getIncomingBlock(Idx) == OrigBB) { in fixPhis() 171 PN->setIncomingBlock(Idx, NewBB); in fixPhis() 180 if (PN->getIncomingBlock(Idx) == OrigBB) { in fixPhis() 187 PN->removeIncomingValue(*III); in fixPhis() 339 PHINode* PN = cast<PHINode>(I); in newLeafBlock() local 344 PN->removeIncomingValue(OrigBlock); in newLeafBlock() 347 int BlockIdx = PN->getBasicBlockIndex(OrigBlock); in newLeafBlock() 349 PN->setIncomingBlock((unsigned)BlockIdx, NewLeaf); in newLeafBlock() [all …]
|
D | LoopUnroll.cpp | 58 if (PHINode *PN = dyn_cast<PHINode>(I)) { in RemapInstruction() local 59 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { in RemapInstruction() 60 ValueToValueMapTy::iterator It = VMap.find(PN->getIncomingBlock(i)); in RemapInstruction() 62 PN->setIncomingBlock(i, cast<BasicBlock>(It->second)); in RemapInstruction() 400 PHINode *PN = OrigPHINode[i]; in UnrollLoop() local 402 PN->replaceAllUsesWith(PN->getIncomingValueForBlock(Preheader)); in UnrollLoop() 403 Header->getInstList().erase(PN); in UnrollLoop() 406 Value *InVal = PN->removeIncomingValue(LatchBlock, false); in UnrollLoop() 414 PN->addIncoming(InVal, Latches.back()); in UnrollLoop()
|
/external/llvm/lib/Analysis/ |
D | SparsePropagation.cpp | 230 void SparseSolver::visitPHINode(PHINode &PN) { in visitPHINode() argument 234 if (LatticeFunc->IsSpecialCasedPHI(&PN)) { in visitPHINode() 235 LatticeVal IV = LatticeFunc->ComputeInstructionState(PN, *this); in visitPHINode() 237 UpdateState(PN, IV); in visitPHINode() 241 LatticeVal PNIV = getOrInitValueState(&PN); in visitPHINode() 250 if (PN.getNumIncomingValues() > 64) { in visitPHINode() 251 UpdateState(PN, Overdefined); in visitPHINode() 258 for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) { in visitPHINode() 260 if (!isEdgeFeasible(PN.getIncomingBlock(i), PN.getParent(), true)) in visitPHINode() 264 LatticeVal OpVal = getOrInitValueState(PN.getIncomingValue(i)); in visitPHINode() [all …]
|
D | ScalarEvolutionExpander.cpp | 818 bool SCEVExpander::isNormalAddRecExprPHI(PHINode *PN, Instruction *IncV, in isNormalAddRecExprPHI() argument 841 if (IncV != PN) in isNormalAddRecExprPHI() 844 return isNormalAddRecExprPHI(PN, IncV, L); in isNormalAddRecExprPHI() 941 bool SCEVExpander::isExpandedAddRecExprPHI(PHINode *PN, Instruction *IncV, in isExpandedAddRecExprPHI() argument 946 if (IVOper == PN) in isExpandedAddRecExprPHI() 955 Value *SCEVExpander::expandIVInc(PHINode *PN, Value *StepV, const Loop *L, in expandIVInc() argument 968 IncV = expandAddToGEP(StepArray, StepArray+1, GEPPtrTy, IntTy, PN); in expandIVInc() 969 if (IncV->getType() != PN->getType()) { in expandIVInc() 970 IncV = Builder.CreateBitCast(IncV, PN->getType()); in expandIVInc() 975 Builder.CreateSub(PN, StepV, Twine(IVName) + ".iv.next") : in expandIVInc() [all …]
|
/external/llvm/lib/Transforms/Scalar/ |
D | LICM.cpp | 89 PHINode &PN, LoopInfo *LI); 493 static bool isTriviallyReplacablePHI(PHINode &PN, Instruction &I) { in isTriviallyReplacablePHI() argument 494 for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) in isTriviallyReplacablePHI() 495 if (PN.getIncomingValue(i) != &I) in isTriviallyReplacablePHI() 508 if (PHINode *PN = dyn_cast<PHINode>(UI)) { in isNotUsedInLoop() local 513 if (isTriviallyReplacablePHI(*PN, I)) { in isNotUsedInLoop() 514 if (CurLoop->contains(PN)) in isNotUsedInLoop() 522 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in isNotUsedInLoop() 523 if (PN->getIncomingValue(i) == &I) in isNotUsedInLoop() 524 if (CurLoop->contains(PN->getIncomingBlock(i))) in isNotUsedInLoop() [all …]
|
D | IndVarSimplify.cpp | 246 void IndVarSimplify::HandleFloatingPointIV(Loop *L, PHINode *PN) { in HandleFloatingPointIV() argument 247 unsigned IncomingEdge = L->contains(PN->getIncomingBlock(0)); in HandleFloatingPointIV() 252 dyn_cast<ConstantFP>(PN->getIncomingValue(IncomingEdge)); in HandleFloatingPointIV() 261 dyn_cast<BinaryOperator>(PN->getIncomingValue(BackEdge)); in HandleFloatingPointIV() 268 if (IncValueVal == nullptr || Incr->getOperand(0) != PN || in HandleFloatingPointIV() 398 IntegerType *Int32Ty = Type::getInt32Ty(PN->getContext()); in HandleFloatingPointIV() 401 PHINode *NewPHI = PHINode::Create(Int32Ty, 2, PN->getName()+".int", PN); in HandleFloatingPointIV() 403 PN->getIncomingBlock(IncomingEdge)); in HandleFloatingPointIV() 408 NewPHI->addIncoming(NewAdd, PN->getIncomingBlock(BackEdge)); in HandleFloatingPointIV() 416 WeakVH WeakPH = PN; in HandleFloatingPointIV() [all …]
|
D | JumpThreading.cpp | 135 bool ProcessBranchOnPHI(PHINode *PN); 397 if (PHINode *PN = dyn_cast<PHINode>(I)) { in ComputeValueKnownInPredecessors() local 398 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) { in ComputeValueKnownInPredecessors() 399 Value *InVal = PN->getIncomingValue(i); in ComputeValueKnownInPredecessors() 401 Result.push_back(std::make_pair(KC, PN->getIncomingBlock(i))); in ComputeValueKnownInPredecessors() 404 PN->getIncomingBlock(i), in ComputeValueKnownInPredecessors() 407 Result.push_back(std::make_pair(KC, PN->getIncomingBlock(i))); in ComputeValueKnownInPredecessors() 503 PHINode *PN = dyn_cast<PHINode>(Cmp->getOperand(0)); in ComputeValueKnownInPredecessors() local 504 if (PN && PN->getParent() == BB) { in ComputeValueKnownInPredecessors() 505 const DataLayout &DL = PN->getModule()->getDataLayout(); in ComputeValueKnownInPredecessors() [all …]
|
D | InductiveRangeCheckElimination.cpp | 524 static void replacePHIBlock(PHINode *PN, BasicBlock *Block, 623 void LoopConstrainer::replacePHIBlock(PHINode *PN, BasicBlock *Block, in replacePHIBlock() argument 625 for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) in replacePHIBlock() 626 if (PN->getIncomingBlock(i) == Block) in replacePHIBlock() 627 PN->setIncomingBlock(i, ReplaceBy); in replacePHIBlock() 959 PHINode *PN = cast<PHINode>(&I); in cloneLoop() local 960 Value *OldIncoming = PN->getIncomingValueForBlock(OriginalBB); in cloneLoop() 961 PN->addIncoming(GetClonedValue(OldIncoming), ClonedBB); in cloneLoop() 1095 PHINode *PN = cast<PHINode>(&I); in changeIterationSpaceEnd() local 1097 PHINode *NewPHI = PHINode::Create(PN->getType(), 2, PN->getName() + ".copy", in changeIterationSpaceEnd() [all …]
|
/external/llvm/lib/CodeGen/SelectionDAG/ |
D | FunctionLoweringInfo.cpp | 248 const PHINode *PN = dyn_cast<PHINode>(I); ++I) { in set() 249 if (PN->use_empty()) continue; in set() 252 if (PN->getType()->isEmptyTy()) in set() 255 DebugLoc DL = PN->getDebugLoc(); in set() 256 unsigned PHIReg = ValueMap[PN]; in set() 260 ComputeValueVTs(*TLI, PN->getType(), ValueVTs); in set() 530 void FunctionLoweringInfo::ComputePHILiveOutRegInfo(const PHINode *PN) { in ComputePHILiveOutRegInfo() argument 531 Type *Ty = PN->getType(); in ComputePHILiveOutRegInfo() 541 if (TLI->getNumRegisters(PN->getContext(), IntVT) != 1) in ComputePHILiveOutRegInfo() 543 IntVT = TLI->getTypeToTransformTo(PN->getContext(), IntVT); in ComputePHILiveOutRegInfo() [all …]
|
/external/llvm/include/llvm/Analysis/ |
D | ScalarEvolutionExpander.h | 194 void setChainedPhi(PHINode *PN) { ChainedPhis.insert(PN); } 264 bool isNormalAddRecExprPHI(PHINode *PN, Instruction *IncV, const Loop *L); 266 bool isExpandedAddRecExprPHI(PHINode *PN, Instruction *IncV, const Loop *L); 275 Value *expandIVInc(PHINode *PN, Value *StepV, const Loop *L,
|
/external/llvm/lib/Target/XCore/ |
D | XCoreLowerThreadLocal.cpp | 136 if (PHINode *PN = dyn_cast<PHINode>(WU)) { in replaceConstantExprOp() local 137 for (int I = 0, E = PN->getNumIncomingValues(); I < E; ++I) in replaceConstantExprOp() 138 if (PN->getIncomingValue(I) == CE) { in replaceConstantExprOp() 139 BasicBlock *PredBB = PN->getIncomingBlock(I); in replaceConstantExprOp() 141 PredBB = SplitEdge(PredBB, PN->getParent()); in replaceConstantExprOp() 144 PN->setOperand(I, NewInst); in replaceConstantExprOp()
|