class VPBlockUtils

Declaration

class VPBlockUtils { /* full declaration omitted */ };

Description

Class that provides utilities for VPBlockBases in VPlan.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:2814

Method Overview

  • public VPBlockUtils()
  • public template <typename BlockTy, typename T>static auto blocksOnly(const T & Range)
  • public static void connectBlocks(llvm::VPBlockBase * From, llvm::VPBlockBase * To)
  • public static void disconnectBlocks(llvm::VPBlockBase * From, llvm::VPBlockBase * To)
  • public static void insertBlockAfter(llvm::VPBlockBase * NewBlock, llvm::VPBlockBase * BlockPtr)
  • public static void insertTwoBlocksAfter(llvm::VPBlockBase * IfTrue, llvm::VPBlockBase * IfFalse, llvm::VPBlockBase * BlockPtr)
  • public static llvm::VPBasicBlock * tryToMergeBlockIntoPredecessor(llvm::VPBlockBase * Block)

Methods

VPBlockUtils()

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:2816

template <typename BlockTy, typename T>
static auto blocksOnly(const T& Range)

Description

Return an iterator range over \p Range which only includes \p BlockTy blocks. The accesses are casted to \p BlockTy.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:2904

Templates

BlockTy
T

Parameters

const T& Range

static void connectBlocks(llvm::VPBlockBase* From,
                          llvm::VPBlockBase* To)

Description

Connect VPBlockBases \p From and \p To bi-directionally. Append \p To to the successors of \p From and \p From to the predecessors of \p To. Both VPBlockBases must have the same parent, which can be null. Both VPBlockBases can be already connected to other VPBlockBases.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:2859

Parameters

llvm::VPBlockBase* From
llvm::VPBlockBase* To

static void disconnectBlocks(
    llvm::VPBlockBase* From,
    llvm::VPBlockBase* To)

Description

Disconnect VPBlockBases \p From and \p To bi-directionally. Remove \p To from the successors of \p From and \p From from the predecessors of \p To.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:2870

Parameters

llvm::VPBlockBase* From
llvm::VPBlockBase* To

static void insertBlockAfter(
    llvm::VPBlockBase* NewBlock,
    llvm::VPBlockBase* BlockPtr)

Description

Insert disconnected VPBlockBase \p NewBlock after \p BlockPtr. Add \p NewBlock as successor of \p BlockPtr and \p BlockPtr as predecessor of \p NewBlock, and propagate \p BlockPtr parent to \p NewBlock. \p BlockPtr's successors are moved from \p BlockPtr to \p NewBlock. \p NewBlock must have neither successors nor predecessors.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:2823

Parameters

llvm::VPBlockBase* NewBlock
llvm::VPBlockBase* BlockPtr

static void insertTwoBlocksAfter(
    llvm::VPBlockBase* IfTrue,
    llvm::VPBlockBase* IfFalse,
    llvm::VPBlockBase* BlockPtr)

Description

Insert disconnected VPBlockBases \p IfTrue and \p IfFalse after \p BlockPtr. Add \p IfTrue and \p IfFalse as succesors of \p BlockPtr and \p BlockPtr as predecessor of \p IfTrue and \p IfFalse. Propagate \p BlockPtr parent to \p IfTrue and \p IfFalse. \p BlockPtr must have no successors and \p IfTrue and \p IfFalse must have neither successors nor predecessors.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:2842

Parameters

llvm::VPBlockBase* IfTrue
llvm::VPBlockBase* IfFalse
llvm::VPBlockBase* BlockPtr

static llvm::VPBasicBlock*
tryToMergeBlockIntoPredecessor(
    llvm::VPBlockBase* Block)

Description

Try to merge \p Block into its single predecessor, if \p Block is a VPBasicBlock and its predecessor has a single successor. Returns a pointer to the predecessor \p Block was merged into or nullptr otherwise.

Declared at: llvm/lib/Transforms/Vectorize/VPlan.h:2879

Parameters

llvm::VPBlockBase* Block