Lines Matching defs:VPBlockBase
12 /// VPBlockBase, together implementing a Hierarchical CFG;
390 /// VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
391 /// A VPBlockBase can be either a VPBasicBlock or a VPRegionBlock.
392 class VPBlockBase {
400 /// The immediate VPRegionBlock which this VPBlockBase belongs to, or null if
401 /// it is a topmost VPBlockBase.
405 SmallVector<VPBlockBase *, 1> Predecessors;
408 SmallVector<VPBlockBase *, 1> Successors;
415 void appendSuccessor(VPBlockBase *Successor) {
421 void appendPredecessor(VPBlockBase *Predecessor) {
427 void removePredecessor(VPBlockBase *Predecessor) {
434 void removeSuccessor(VPBlockBase *Successor) {
442 void replacePredecessor(VPBlockBase *Old, VPBlockBase *New) {
452 void replaceSuccessor(VPBlockBase *Old, VPBlockBase *New) {
461 VPBlockBase(const unsigned char SC, const std::string &N)
465 /// An enumeration for keeping track of the concrete subclass of VPBlockBase
467 /// SubclassID field of the VPBlockBase objects. They are used for concrete
471 using VPBlocksTy = SmallVectorImpl<VPBlockBase *>;
473 virtual ~VPBlockBase() = default;
497 /// \return the VPBasicBlock that is the entry of this VPBlockBase,
499 /// VPBlockBase is a VPBasicBlock, it is returned.
503 /// \return the VPBasicBlock that is the exiting this VPBlockBase,
505 /// VPBlockBase is a VPBasicBlock, it is returned.
512 iterator_range<VPBlockBase **> successors() { return Successors; }
513 iterator_range<VPBlockBase **> predecessors() { return Predecessors; }
518 /// \return the successor of this VPBlockBase if it has a single successor.
520 VPBlockBase *getSingleSuccessor() const {
524 /// \return the predecessor of this VPBlockBase if it has a single
526 VPBlockBase *getSinglePredecessor() const {
537 VPBlockBase *getEnclosingBlockWithSuccessors();
542 VPBlockBase *getEnclosingBlockWithPredecessors();
544 /// \return the successors either attached directly to this VPBlockBase or, if
545 /// this VPBlockBase is the exit block of a VPRegionBlock and has no
549 /// VPBlockBase reached.
554 /// \return the hierarchical successor of this VPBlockBase if it has a single
556 VPBlockBase *getSingleHierarchicalSuccessor() {
560 /// \return the predecessors either attached directly to this VPBlockBase or,
561 /// if this VPBlockBase is the entry block of a VPRegionBlock and has no
565 /// VPBlockBase reached.
570 /// \return the hierarchical predecessor of this VPBlockBase if it has a
572 VPBlockBase *getSingleHierarchicalPredecessor() {
576 /// Set a given VPBlockBase \p Successor as the single successor of this
577 /// VPBlockBase. This VPBlockBase is not added as predecessor of \p Successor.
578 /// This VPBlockBase must have no successors.
579 void setOneSuccessor(VPBlockBase *Successor) {
587 /// successors of this VPBlockBase. This VPBlockBase is not added as
588 /// predecessor of \p IfTrue or \p IfFalse. This VPBlockBase must have no
590 void setTwoSuccessors(VPBlockBase *IfTrue, VPBlockBase *IfFalse) {
596 /// Set each VPBasicBlock in \p NewPreds as predecessor of this VPBlockBase.
597 /// This VPBlockBase must have no predecessors. This VPBlockBase is not added
599 void setPredecessors(ArrayRef<VPBlockBase *> NewPreds) {
605 /// Set each VPBasicBlock in \p NewSuccss as successor of this VPBlockBase.
606 /// This VPBlockBase must have no successors. This VPBlockBase is not added
608 void setSuccessors(ArrayRef<VPBlockBase *> NewSuccs) {
629 /// VPBlockBase, thereby "executing" the VPlan.
638 // hoisted into a VPBlockBase.
647 /// Print plain-text dump of this VPBlockBase to \p O, prefixing all lines
666 /// Dump this VPBlockBase to dbgs().
673 virtual VPBlockBase *clone() = 0;
3541 class VPBasicBlock : public VPBlockBase {
3546 : VPBlockBase(VPBasicBlockSC, Name.str()) {
3559 : VPBlockBase(BlockSC, Name.str()) {}
3602 static inline bool classof(const VPBlockBase *V) {
3603 return V->getVPBlockID() == VPBlockBase::VPBasicBlockSC ||
3604 V->getVPBlockID() == VPBlockBase::VPIRBasicBlockSC;
3649 using VPBlockBase::print; // Get the print(raw_stream &O) version.
3697 static inline bool classof(const VPBlockBase *V) {
3698 return V->getVPBlockID() == VPBlockBase::VPIRBasicBlockSC;
3718 class VPRegionBlock : public VPBlockBase {
3722 VPBlockBase *Entry;
3726 VPBlockBase *Exiting;
3733 VPRegionBlock(VPBlockBase *Entry, VPBlockBase *Exiting,
3735 : VPBlockBase(VPRegionBlockSC, Name), Entry(Entry), Exiting(Exiting),
3743 : VPBlockBase(VPRegionBlockSC, Name), Entry(nullptr), Exiting(nullptr),
3750 static inline bool classof(const VPBlockBase *V) {
3751 return V->getVPBlockID() == VPBlockBase::VPRegionBlockSC;
3754 const VPBlockBase *getEntry() const { return Entry; }
3755 VPBlockBase *getEntry() { return Entry; }
3757 /// Set \p EntryBlock as the entry VPBlockBase of this VPRegionBlock. \p
3759 void setEntry(VPBlockBase *EntryBlock) {
3766 const VPBlockBase *getExiting() const { return Exiting; }
3767 VPBlockBase *getExiting() { return Exiting; }
3769 /// Set \p ExitingBlock as the exiting VPBlockBase of this VPRegionBlock. \p
3771 void setExiting(VPBlockBase *ExitingBlock) {
3804 using VPBlockBase::print; // Get the print(raw_stream &O) version.
3873 SmallVector<VPBlockBase *> CreatedBlocks;
4110 VPRegionBlock *createVPRegionBlock(VPBlockBase *Entry, VPBlockBase *Exiting,
4151 SmallDenseMap<const VPBlockBase *, unsigned> BlockID;
4159 void dumpBlock(const VPBlockBase *Block);
4163 void dumpEdges(const VPBlockBase *Block);
4172 unsigned getOrCreateBID(const VPBlockBase *Block) {
4176 Twine getOrCreateName(const VPBlockBase *Block);
4178 Twine getUID(const VPBlockBase *Block);
4181 void drawEdge(const VPBlockBase *From, const VPBlockBase *To, bool Hidden,
4225 void visitBlock(VPBlockBase *Block, Old2NewTy &Old2New,