/freebsd/contrib/llvm-project/llvm/lib/CodeGen/ |
H A D | MachineSSAUpdater.cpp | 196 InsertNewDef(TargetOpcode::PHI, BB, Loc, RegAttrs, MRI, TII); in GetValueInMiddleOfBlock() 276 MachineInstr *PHI; member in llvm::SSAUpdaterTraits::PHI_iterator 281 : PHI(P), idx(1) {} in PHI_iterator() 283 : PHI(P), idx(PHI->getNumOperands()) {} in PHI_iterator() 289 unsigned getIncomingValue() { return PHI->getOperand(idx).getReg(); } in getIncomingValue() 292 return PHI->getOperand(idx+1).getMBB(); in getIncomingBlock() 296 static inline PHI_iterator PHI_begin(PhiT *PHI) { return PHI_iterator(PHI); } in PHI_begin() argument 298 static inline PHI_iterator PHI_end(PhiT *PHI) { in PHI_end() argument 299 return PHI_iterator(PHI, true); in PHI_end() 325 MachineInstr *PHI = in CreateEmptyPHI() local [all …]
|
H A D | EarlyIfConversion.cpp | 112 MachineInstr *PHI; member 117 PHIInfo(MachineInstr *phi) : PHI(phi) {} in PHIInfo() 519 for (unsigned i = 1; i != PI.PHI->getNumOperands(); i += 2) { in canConvertIf() 520 if (PI.PHI->getOperand(i+1).getMBB() == TPred) in canConvertIf() 521 PI.TReg = PI.PHI->getOperand(i).getReg(); in canConvertIf() 522 if (PI.PHI->getOperand(i+1).getMBB() == FPred) in canConvertIf() 523 PI.FReg = PI.PHI->getOperand(i).getReg(); in canConvertIf() 529 if (!TII->canInsertSelect(*Head, Cond, PI.PHI->getOperand(0).getReg(), in canConvertIf() 532 LLVM_DEBUG(dbgs() << "Can't convert: " << *PI.PHI); in canConvertIf() 621 LLVM_DEBUG(dbgs() << "If-converting " << *PI.PHI); in replacePHIInstrs() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
H A D | CanonicalizeFreezeInLoops.cpp | 97 PHINode *PHI; member 101 FrozenIndPHIInfo(PHINode *PHI, BinaryOperator *StepInst) in FrozenIndPHIInfo() 102 : PHI(PHI), StepInst(StepInst) {} in FrozenIndPHIInfo() 159 for (auto &PHI : L->getHeader()->phis()) { in run() local 161 if (!InductionDescriptor::isInductionPHI(&PHI, L, &SE, ID)) in run() 164 LLVM_DEBUG(dbgs() << "canonfr: PHI: " << PHI << "\n"); in run() 165 FrozenIndPHIInfo Info(&PHI, ID.getInductionBinOp()); in run() 172 Info.StepValIdx = Info.StepInst->getOperand(0) == &PHI; in run() 189 for_each(PHI.users(), Visit); in run() 198 PHINode *PHI = Info.PHI; in run() local [all …]
|
H A D | SSAUpdater.cpp | 77 static bool IsEquivalentPHI(PHINode *PHI, in IsEquivalentPHI() argument 79 unsigned PHINumValues = PHI->getNumIncomingValues(); in IsEquivalentPHI() 85 if (ValueMapping[PHI->getIncomingBlock(i)] != in IsEquivalentPHI() 86 PHI->getIncomingValue(i)) { in IsEquivalentPHI() 275 PHINode *PHI; member in llvm::SSAUpdaterTraits::PHI_iterator 280 : PHI(P), idx(0) {} in PHI_iterator() 282 : PHI(P), idx(PHI->getNumIncomingValues()) {} in PHI_iterator() 288 Value *getIncomingValue() { return PHI->getIncomingValue(idx); } in getIncomingValue() 289 BasicBlock *getIncomingBlock() { return PHI->getIncomingBlock(idx); } in getIncomingBlock() 292 static PHI_iterator PHI_begin(PhiT *PHI) { return PHI_iterator(PHI); } in PHI_begin() argument [all …]
|
H A D | LoopPeel.cpp | 257 for (auto &PHI : L.getHeader()->phis()) { in calculateIterationsToPeel() local 258 PeelCounter ToInvariance = calculate(PHI); in calculateIterationsToPeel() 856 for (PHINode &PHI : Edge.second->phis()) { in cloneLoopBlocks() 857 Value *LatchVal = PHI.getIncomingValueForBlock(Edge.first); in cloneLoopBlocks() 861 PHI.addIncoming(LatchVal, cast<BasicBlock>(VMap[Edge.first])); in cloneLoopBlocks() 862 SE.forgetLcssaPhiWithNewPredecessor(L, &PHI); in cloneLoopBlocks() 1066 PHINode *PHI = cast<PHINode>(I); in peelLoop() local 1067 Value *NewVal = PHI->getIncomingValueForBlock(Latch); in peelLoop() 1072 PHI->setIncomingValueForBlock(NewPreHeader, NewVal); in peelLoop()
|
H A D | FlattenCFG.cpp | 137 PHINode *PHI = dyn_cast<PHINode>(BB->begin()); in FlattenParallelAndOr() local 138 if (PHI) in FlattenParallelAndOr() 273 PHI = dyn_cast<PHINode>(PS2->begin()); in FlattenParallelAndOr() 274 if (PHI) in FlattenParallelAndOr()
|
H A D | SimplifyCFG.cpp | 4038 PHINode *PHI = nullptr; in ensureValueAvailableInSuccessor() local 4043 PHI = cast<PHINode>(I); in ensureValueAvailableInSuccessor() 4050 if (PHI->getIncomingValueForBlock(OtherPredBB) == AlternativeV) in ensureValueAvailableInSuccessor() 4052 PHI = nullptr; in ensureValueAvailableInSuccessor() 4054 if (PHI) in ensureValueAvailableInSuccessor() 4055 return PHI; in ensureValueAvailableInSuccessor() 4062 PHI = PHINode::Create(V->getType(), 2, "simplifycfg.merge"); in ensureValueAvailableInSuccessor() 4063 PHI->insertBefore(Succ->begin()); in ensureValueAvailableInSuccessor() 4064 PHI->addIncoming(V, BB); in ensureValueAvailableInSuccessor() 4067 PHI->addIncoming( in ensureValueAvailableInSuccessor() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/ |
H A D | AMDGPURewriteUndefForPHI.cpp | 14 // analysis reports the PHI in join block of divergent branch as uniform if 16 // value. That is to say the later compiler pipeline will ensure such PHI always 41 // in this pass. So the scalar register allocated for such PHI will get correct 80 return "AMDGPU Rewrite Undef for PHI"; in getPassName() 96 "Rewrite undef for PHI", false, false) 100 "Rewrite undef for PHI", false, false) in INITIALIZE_PASS_DEPENDENCY() 106 for (auto &PHI : BB.phis()) { in INITIALIZE_PASS_DEPENDENCY() 107 if (UA.isDivergent(&PHI)) in INITIALIZE_PASS_DEPENDENCY() local 110 // The unique incoming value except undef/poison for the PHI node. in INITIALIZE_PASS_DEPENDENCY() 118 for (unsigned i = 0; i < PHI in INITIALIZE_PASS_DEPENDENCY() 167 for (auto *PHI : ToBeDeleted) INITIALIZE_PASS_DEPENDENCY() local [all...] |
H A D | AMDGPUMachineCFGStructurizer.cpp | 284 static unsigned getPHINumInputs(MachineInstr &PHI) { in getPHINumInputs() argument 285 assert(PHI.isPHI()); in getPHINumInputs() 286 return (PHI.getNumOperands() - 1) / 2; in getPHINumInputs() 289 static MachineBasicBlock *getPHIPred(MachineInstr &PHI, unsigned Index) { in getPHIPred() argument 290 assert(PHI.isPHI()); in getPHIPred() 291 return PHI.getOperand(Index * 2 + 2).getMBB(); in getPHIPred() 294 static void setPhiPred(MachineInstr &PHI, unsigned Index, in setPhiPred() argument 296 PHI.getOperand(Index * 2 + 2).setMBB(NewPred); in setPhiPred() 299 static unsigned getPHISourceReg(MachineInstr &PHI, unsigned Index) { in getPHISourceReg() argument 300 assert(PHI.isPHI()); in getPHISourceReg() [all …]
|
H A D | AMDGPULowerBufferFatPointers.cpp | 764 PtrParts visitPHINode(PHINode &PHI); 832 if (auto *PHI = dyn_cast<PHINode>(I)) { in getPossibleRsrcRoots() local 835 for (Value *In : PHI->incoming_values()) { in getPossibleRsrcRoots() 904 if (auto *PHI = dyn_cast<PHINode>(I)) { in processConditionals() local 906 StructType *PHITy = cast<StructType>(PHI->getType()); in processConditionals() 907 IRB.SetInsertPoint(*PHI->getInsertionPointAfterDef()); in processConditionals() 908 IRB.SetCurrentDebugLocation(PHI->getDebugLoc()); in processConditionals() 913 auto *RsrcPHI = IRB.CreatePHI(RsrcTy, PHI->getNumIncomingValues()); in processConditionals() 915 for (auto [V, BB] : llvm::zip(PHI->incoming_values(), PHI->blocks())) { in processConditionals() 919 copyMetadata(RsrcPHI, PHI); in processConditionals() [all …]
|
H A D | SIOptimizeVGPRLiveRange.cpp | 509 MachineInstrBuilder PHI = BuildMI(*Flow, Flow->getFirstNonPHI(), DebugLoc(), in optimizeLiveRange() local 510 TII->get(TargetOpcode::PHI), NewReg); in optimizeLiveRange() 513 PHI.addReg(Reg).addMBB(Pred); in optimizeLiveRange() 515 PHI.addReg(UndefReg, RegState::Undef).addMBB(Pred); in optimizeLiveRange() 572 MachineInstrBuilder PHI = in optimizeWaterfallLiveRange() local 574 TII->get(TargetOpcode::PHI), NewReg); in optimizeWaterfallLiveRange() 577 PHI.addReg(UndefReg, RegState::Undef).addMBB(Pred); in optimizeWaterfallLiveRange() 579 PHI.addReg(Reg).addMBB(Pred); in optimizeWaterfallLiveRange()
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Transforms/Utils/ |
H A D | SSAUpdaterImpl.h | 373 ValT PHI = Traits::CreateEmptyPHI(Info->BB, Info->NumPreds, Updater); in FindAvailableVals() local 374 Info->AvailableVal = PHI; in FindAvailableVals() 375 (*AvailableVals)[Info->BB] = PHI; in FindAvailableVals() 392 PhiT *PHI = Traits::ValueIsNewPHI(Info->AvailableVal, Updater); in FindAvailableVals() local 393 if (!PHI) in FindAvailableVals() 403 Traits::AddPHIOperand(PHI, PredInfo->AvailableVal, Pred); in FindAvailableVals() 406 LLVM_DEBUG(dbgs() << " Inserted PHI: " << *PHI << "\n"); in FindAvailableVals() 409 if (InsertedPHIs) InsertedPHIs->push_back(PHI); in FindAvailableVals() 430 bool CheckIfPHIMatches(PhiT *PHI) { in CheckIfPHIMatches() argument 432 WorkList.push_back(PHI); in CheckIfPHIMatches() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Target/RISCV/ |
H A D | RISCVCodeGenPrepare.cpp | 144 auto *PHI = dyn_cast<PHINode>(I.getOperand(0)); in visitIntrinsicInst() local 145 if (!PHI || !PHI->hasOneUse() || in visitIntrinsicInst() 146 !llvm::is_contained(PHI->incoming_values(), &I)) in visitIntrinsicInst() 150 IRBuilder<> Builder(PHI); in visitIntrinsicInst() 151 auto *VecPHI = Builder.CreatePHI(VecTy, PHI->getNumIncomingValues()); in visitIntrinsicInst() 153 for (auto *BB : PHI->blocks()) { in visitIntrinsicInst() 156 VecTy, PHI->getIncomingValueForBlock(BB), (uint64_t)0); in visitIntrinsicInst() 163 PHI->eraseFromParent(); in visitIntrinsicInst()
|
/freebsd/contrib/llvm-project/llvm/lib/Target/X86/ |
H A D | X86FastPreTileConfig.cpp | 75 void convertPHI(MachineBasicBlock *MBB, MachineInstr &PHI); 323 MachineInstr &PHI) { in convertPHI() argument 330 MachineInstrBuilder AddrPHI = BuildMI(*MBB, ++PHI.getIterator(), DebugLoc(), in convertPHI() 331 TII->get(X86::PHI), StackAddrReg); in convertPHI() 333 MachineInstrBuilder RowPHI = BuildMI(*MBB, ++PHI.getIterator(), DebugLoc(), in convertPHI() 334 TII->get(X86::PHI), RowReg); in convertPHI() 336 MachineInstrBuilder ColPHI = BuildMI(*MBB, ++PHI.getIterator(), DebugLoc(), in convertPHI() 337 TII->get(X86::PHI), ColReg); in convertPHI() 339 VisitedPHIs[&PHI] = {RowReg, ColReg, StackAddrReg}; in convertPHI() 341 for (unsigned I = 1, E = PHI.getNumOperands(); I != E; I += 2) { in convertPHI() [all …]
|
H A D | X86LowerAMXType.cpp | 532 void replacePhiDefWithLoad(Instruction *PHI, Value *StorePtr); 534 void volatileTilePHI(PHINode *PHI); 556 void X86VolatileTileData::replacePhiDefWithLoad(Instruction *PHI, in replacePhiDefWithLoad() argument 558 for (Use &U : PHI->uses()) in replacePhiDefWithLoad() 560 PHI->eraseFromParent(); in replacePhiDefWithLoad() 618 void X86VolatileTileData::volatileTilePHI(PHINode *PHI) { in volatileTilePHI() argument 619 BasicBlock *BB = PHI->getParent(); in volatileTilePHI() 622 for (unsigned I = 0, E = PHI->getNumIncomingValues(); I != E; ++I) { in volatileTilePHI() 623 Value *Op = PHI->getIncomingValue(I); in volatileTilePHI() 630 replacePhiDefWithLoad(PHI, StorePtr); in volatileTilePHI() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/ |
H A D | LoopInterchange.cpp | 696 PHINode *PHI = dyn_cast<PHINode>(SV); in followLCSSA() local 697 if (!PHI) in followLCSSA() 700 if (PHI->getNumIncomingValues() != 1) in followLCSSA() 702 return followLCSSA(PHI->getIncomingValue(0)); in followLCSSA() 712 if (PHINode *PHI = dyn_cast<PHINode>(User)) { in findInnerReductionPhi() local 713 if (PHI->getNumIncomingValues() == 1) in findInnerReductionPhi() 716 if (RecurrenceDescriptor::isReductionPHI(PHI, L, RD)) { in findInnerReductionPhi() 720 return PHI; in findInnerReductionPhi() 733 for (PHINode &PHI : L->getHeader()->phis()) { in findInductionAndReductions() 735 if (InductionDescriptor::isInductionPHI(&PHI, L, SE, ID)) in findInductionAndReductions() [all …]
|
H A D | JumpTableToSwitch.cpp | 116 PHINode *PHI = in expandToSwitch() local 131 if (PHI) in expandToSwitch() 132 PHI->addIncoming(Call, B); in expandToSwitch() 139 if (PHI) in expandToSwitch() 140 CB->replaceAllUsesWith(PHI); in expandToSwitch()
|
H A D | GVNSink.cpp | 748 for (auto &PHI : NeededPHIs) in analyzeInstructionForSinking() local 749 PHIContents.insert(PHI.getValues().begin(), PHI.getValues().end()); in analyzeInstructionForSinking() 774 ModelledPHI PHI(NewInsts, OpNum, ActivePreds); in analyzeInstructionForSinking() local 775 if (PHI.areAllIncomingValuesSame()) in analyzeInstructionForSinking() 780 if (NeededPHIs.count(PHI)) in analyzeInstructionForSinking() 782 if (!PHI.areAllIncomingValuesSameType()) in analyzeInstructionForSinking() 786 PHI.areAnyIncomingValuesConstant()) in analyzeInstructionForSinking() 790 NeededPHIs.insert(PHI); in analyzeInstructionForSinking() 791 PHIContents.insert(PHI.getValues().begin(), PHI.getValues().end()); in analyzeInstructionForSinking()
|
H A D | LoopLoadElimination.cpp | 456 PHINode *PHI = PHINode::Create(Initial->getType(), 2, "store_forwarded"); in propagateStoredValueToLoadUsers() local 457 PHI->insertBefore(L->getHeader()->begin()); in propagateStoredValueToLoadUsers() 458 PHI->addIncoming(Initial, PH); in propagateStoredValueToLoadUsers() 479 PHI->addIncoming(StoreValue, L->getLoopLatch()); in propagateStoredValueToLoadUsers() 481 Cand.Load->replaceAllUsesWith(PHI); in propagateStoredValueToLoadUsers() 482 PHI->setDebugLoc(Cand.Load->getDebugLoc()); in propagateStoredValueToLoadUsers()
|
H A D | LoopFuse.cpp | 1605 for (PHINode &PHI : FC0.Header->phis()) in performFusion() 1606 OriginalFC0PHIs.push_back(&PHI); in performFusion() 1662 while (PHINode *PHI = dyn_cast<PHINode>(&FC1.Header->front())) { in performFusion() local 1663 if (SE.isSCEVable(PHI->getType())) in performFusion() 1664 SE.forgetValue(PHI); in performFusion() 1665 if (PHI->hasNUsesOrMore(1)) in performFusion() 1666 PHI->moveBefore(&*FC0.Header->getFirstInsertionPt()); in performFusion() 1668 PHI->eraseFromParent(); in performFusion() 1895 for (PHINode &PHI : FC0.Header->phis()) in fuseGuardedLoops() 1896 OriginalFC0PHIs.push_back(&PHI); in fuseGuardedLoops() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/ |
H A D | InstCombineNegator.cpp | 311 case Instruction::PHI: { in visitImpl() 313 auto *PHI = cast<PHINode>(I); in visitImpl() local 314 SmallVector<Value *, 4> NegatedIncomingValues(PHI->getNumOperands()); in visitImpl() 315 for (auto I : zip(PHI->incoming_values(), NegatedIncomingValues)) { in visitImpl() 322 PHI->getType(), PHI->getNumOperands(), PHI->getName() + ".neg"); in visitImpl() 323 for (auto I : zip(NegatedIncomingValues, PHI->blocks())) in visitImpl()
|
H A D | InstCombineLoadStoreAlloca.cpp | 303 } else if (auto *PHI = dyn_cast<PHINode>(Inst)) { in collectUsersRecursive() local 305 if (any_of(PHI->incoming_values(), in collectUsersRecursive() 312 if (any_of(PHI->incoming_values(), [this](Value *V) { in collectUsersRecursive() 319 Worklist.insert(PHI); in collectUsersRecursive() 320 if (!collectUsersRecursive(*PHI)) in collectUsersRecursive() 378 } else if (auto *PHI = dyn_cast<PHINode>(I)) { in replace() local 379 Type *NewTy = getReplacement(PHI->getIncomingValue(0))->getType(); in replace() 380 auto *NewPHI = PHINode::Create(NewTy, PHI->getNumIncomingValues(), in replace() 381 PHI->getName(), PHI->getIterator()); in replace() 382 for (unsigned int I = 0; I < PHI->getNumIncomingValues(); ++I) in replace() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/ObjCARC/ |
H A D | ObjCARCContract.cpp | 619 if (PHINode *PHI = dyn_cast<PHINode>(U.getUser())) { in run() local 622 BasicBlock *IncomingBB = PHI->getIncomingBlock(ValNo); in run() 641 for (unsigned i = 0, e = PHI->getNumIncomingValues(); i != e; ++i) in run() 642 if (PHI->getIncomingBlock(i) == IncomingBB) { in run() 645 &PHI->getOperandUse( in run() 648 PHI->setIncomingValue(i, Replacement); in run() 682 for (Value *PHI : PHIList) in run() 683 ReplaceArgUses(PHI); in run()
|
/freebsd/contrib/llvm-project/llvm/lib/Target/PowerPC/ |
H A D | PPCMIPeephole.cpp | 374 } else if (Opcode != PPC::IMPLICIT_DEF && Opcode != PPC::PHI) in collectUnprimedAccPHIs() 380 if (Opcode != PPC::PHI) in collectUnprimedAccPHIs() 399 for (MachineInstr *PHI : llvm::reverse(PHIs)) { in convertUnprimedAccPHIs() 405 for (unsigned PHIOp = 1, NumOps = PHI->getNumOperands(); PHIOp != NumOps; in convertUnprimedAccPHIs() 407 Register RegOp = PHI->getOperand(PHIOp).getReg(); in convertUnprimedAccPHIs() 411 Opcode == PPC::PHI) && in convertUnprimedAccPHIs() 417 PHIOps.push_back({PHIInput->getOperand(1), PHI->getOperand(PHIOp + 1)}); in convertUnprimedAccPHIs() 423 PHI->getOperand(PHIOp + 1)}); in convertUnprimedAccPHIs() 424 } else if (Opcode == PPC::PHI) { in convertUnprimedAccPHIs() 433 PHI->getOperand(PHIOp + 1)}); in convertUnprimedAccPHIs() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/ |
H A D | PGOMemOPSizeOpt.cpp | 386 PHINode *PHI = nullptr; in perform() local 390 PHI = IRBM.CreatePHI(MemOpTy, SizeIds.size() + 1, "MemOP.RVMerge"); in perform() 391 MO.I->replaceAllUsesWith(PHI); in perform() 392 PHI->addIncoming(MO.I, DefaultBB); in perform() 424 PHI->addIncoming(NewMO.I, CaseBB); in perform()
|