Lines Matching defs:VPBlockBase
12 /// VPBlockBase, together implementing a Hierarchical CFG;
435 /// VPBlockBase is the building block of the Hierarchical Control-Flow Graph.
436 /// A VPBlockBase can be either a VPBasicBlock or a VPRegionBlock.
437 class VPBlockBase {
445 /// The immediate VPRegionBlock which this VPBlockBase belongs to, or null if
446 /// it is a topmost VPBlockBase.
450 SmallVector<VPBlockBase *, 1> Predecessors;
453 SmallVector<VPBlockBase *, 1> Successors;
460 void appendSuccessor(VPBlockBase *Successor) {
466 void appendPredecessor(VPBlockBase *Predecessor) {
472 void removePredecessor(VPBlockBase *Predecessor) {
479 void removeSuccessor(VPBlockBase *Successor) {
486 VPBlockBase(const unsigned char SC, const std::string &N)
490 /// An enumeration for keeping track of the concrete subclass of VPBlockBase
492 /// SubclassID field of the VPBlockBase objects. They are used for concrete
496 using VPBlocksTy = SmallVectorImpl<VPBlockBase *>;
498 virtual ~VPBlockBase() = default;
522 /// \return the VPBasicBlock that is the entry of this VPBlockBase,
524 /// VPBlockBase is a VPBasicBlock, it is returned.
528 /// \return the VPBasicBlock that is the exiting this VPBlockBase,
530 /// VPBlockBase is a VPBasicBlock, it is returned.
537 iterator_range<VPBlockBase **> successors() { return Successors; }
542 /// \return the successor of this VPBlockBase if it has a single successor.
544 VPBlockBase *getSingleSuccessor() const {
548 /// \return the predecessor of this VPBlockBase if it has a single
550 VPBlockBase *getSinglePredecessor() const {
561 VPBlockBase *getEnclosingBlockWithSuccessors();
566 VPBlockBase *getEnclosingBlockWithPredecessors();
568 /// \return the successors either attached directly to this VPBlockBase or, if
569 /// this VPBlockBase is the exit block of a VPRegionBlock and has no
573 /// VPBlockBase reached.
578 /// \return the hierarchical successor of this VPBlockBase if it has a single
580 VPBlockBase *getSingleHierarchicalSuccessor() {
584 /// \return the predecessors either attached directly to this VPBlockBase or,
585 /// if this VPBlockBase is the entry block of a VPRegionBlock and has no
589 /// VPBlockBase reached.
594 /// \return the hierarchical predecessor of this VPBlockBase if it has a
596 VPBlockBase *getSingleHierarchicalPredecessor() {
600 /// Set a given VPBlockBase \p Successor as the single successor of this
601 /// VPBlockBase. This VPBlockBase is not added as predecessor of \p Successor.
602 /// This VPBlockBase must have no successors.
603 void setOneSuccessor(VPBlockBase *Successor) {
611 /// successors of this VPBlockBase. This VPBlockBase is not added as
612 /// predecessor of \p IfTrue or \p IfFalse. This VPBlockBase must have no
614 void setTwoSuccessors(VPBlockBase *IfTrue, VPBlockBase *IfFalse) {
620 /// Set each VPBasicBlock in \p NewPreds as predecessor of this VPBlockBase.
621 /// This VPBlockBase must have no predecessors. This VPBlockBase is not added
623 void setPredecessors(ArrayRef<VPBlockBase *> NewPreds) {
629 /// Set each VPBasicBlock in \p NewSuccss as successor of this VPBlockBase.
630 /// This VPBlockBase must have no successors. This VPBlockBase is not added
632 void setSuccessors(ArrayRef<VPBlockBase *> NewSuccs) {
645 /// VPBlockBase, thereby "executing" the VPlan.
651 /// Delete all blocks reachable from a given VPBlockBase, inclusive.
652 static void deleteCFG(VPBlockBase *Entry);
657 // hoisted into a VPBlockBase.
670 /// Print plain-text dump of this VPBlockBase to \p O, prefixing all lines
689 /// Dump this VPBlockBase to dbgs().
696 virtual VPBlockBase *clone() = 0;
2971 class VPBasicBlock : public VPBlockBase {
2980 : VPBlockBase(BlockSC, Name.str()) {}
2984 : VPBlockBase(VPBasicBlockSC, Name.str()) {
3029 static inline bool classof(const VPBlockBase *V) {
3030 return V->getVPBlockID() == VPBlockBase::VPBasicBlockSC ||
3031 V->getVPBlockID() == VPBlockBase::VPIRBasicBlockSC;
3077 using VPBlockBase::print; // Get the print(raw_stream &O) version.
3123 static inline bool classof(const VPBlockBase *V) {
3124 return V->getVPBlockID() == VPBlockBase::VPIRBasicBlockSC;
3149 class VPRegionBlock : public VPBlockBase {
3151 VPBlockBase *Entry;
3155 VPBlockBase *Exiting;
3162 VPRegionBlock(VPBlockBase *Entry, VPBlockBase *Exiting,
3164 : VPBlockBase(VPRegionBlockSC, Name), Entry(Entry), Exiting(Exiting),
3172 : VPBlockBase(VPRegionBlockSC, Name), Entry(nullptr), Exiting(nullptr),
3184 static inline bool classof(const VPBlockBase *V) {
3185 return V->getVPBlockID() == VPBlockBase::VPRegionBlockSC;
3188 const VPBlockBase *getEntry() const { return Entry; }
3189 VPBlockBase *getEntry() { return Entry; }
3191 /// Set \p EntryBlock as the entry VPBlockBase of this VPRegionBlock. \p
3193 void setEntry(VPBlockBase *EntryBlock) {
3200 const VPBlockBase *getExiting() const { return Exiting; }
3201 VPBlockBase *getExiting() { return Exiting; }
3203 /// Set \p ExitingBlock as the exiting VPBlockBase of this VPRegionBlock. \p
3205 void setExiting(VPBlockBase *ExitingBlock) {
3240 using VPBlockBase::print; // Get the print(raw_stream &O) version.
3511 SmallDenseMap<const VPBlockBase *, unsigned> BlockID;
3519 void dumpBlock(const VPBlockBase *Block);
3523 void dumpEdges(const VPBlockBase *Block);
3532 unsigned getOrCreateBID(const VPBlockBase *Block) {
3536 Twine getOrCreateName(const VPBlockBase *Block);
3538 Twine getUID(const VPBlockBase *Block);
3541 void drawEdge(const VPBlockBase *From, const VPBlockBase *To, bool Hidden,
3579 /// Insert disconnected VPBlockBase \p NewBlock after \p BlockPtr. Add \p
3584 static void insertBlockAfter(VPBlockBase *NewBlock, VPBlockBase *BlockPtr) {
3589 SmallVector<VPBlockBase *> Succs(BlockPtr->successors());
3590 for (VPBlockBase *Succ : Succs) {
3603 static void insertTwoBlocksAfter(VPBlockBase *IfTrue, VPBlockBase *IfFalse,
3604 VPBlockBase *BlockPtr) {
3620 static void connectBlocks(VPBlockBase *From, VPBlockBase *To) {
3631 static void disconnectBlocks(VPBlockBase *From, VPBlockBase *To) {
3643 const VPBlockBase, VPBlockBase>;
3672 void visitBlock(VPBlockBase *Block, Old2NewTy &Old2New,