LLVM 20.0.0git
Namespaces | Macros | Functions | Variables
VPlan.cpp File Reference

This is the LLVM vectorization plan. More...

#include "VPlan.h"
#include "LoopVectorizationPlanner.h"
#include "VPlanCFG.h"
#include "VPlanPatternMatch.h"
#include "VPlanTransforms.h"
#include "VPlanUtils.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/DomTreeUpdater.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/GraphWriter.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/LoopVersioning.h"
#include <cassert>
#include <string>

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define DEBUG_TYPE   "loop-vectorize"
 

Functions

template<typename T >
static TgetPlanEntry (T *Start)
 
template<typename T >
static TgetEnclosingLoopRegionForRegion (T *P)
 Return the enclosing loop region for region P.
 
static bool hasConditionalTerminator (const VPBasicBlock *VPBB)
 
static std::pair< VPBlockBase *, VPBlockBase * > cloneFrom (VPBlockBase *Entry)
 
static void replaceVPBBWithIRVPBB (VPBasicBlock *VPBB, BasicBlock *IRBB)
 Replace VPBB with a VPIRBasicBlock wrapping IRBB.
 
static void remapOperands (VPBlockBase *Entry, VPBlockBase *NewEntry, DenseMap< VPValue *, VPValue * > &Old2NewVPValues)
 

Variables

cl::opt< unsignedForceTargetInstructionCost
 
static cl::opt< boolPrintVPlansInDotFormat ("vplan-print-in-dot-format", cl::Hidden, cl::desc("Use dot format instead of plain text when dumping VPlans"))
 

Detailed Description

This is the LLVM vectorization plan.

It represents a candidate for vectorization, allowing to plan and optimize how to vectorize a given loop before generating LLVM-IR. The vectorizer uses vectorization plans to estimate the costs of potential candidates and if profitable to execute the desired plan, generating vector LLVM-IR code.

Definition in file VPlan.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loop-vectorize"

Definition at line 61 of file VPlan.cpp.

Function Documentation

◆ cloneFrom()

static std::pair< VPBlockBase *, VPBlockBase * > cloneFrom ( VPBlockBase Entry)
static

◆ getEnclosingLoopRegionForRegion()

template<typename T >
static T * getEnclosingLoopRegionForRegion ( T P)
static

Return the enclosing loop region for region P.

The templated version is used to support both const and non-const block arguments.

Definition at line 557 of file VPlan.cpp.

References assert(), and P.

Referenced by llvm::VPBasicBlock::getEnclosingLoopRegion().

◆ getPlanEntry()

template<typename T >
static T * getPlanEntry ( T Start)
static

◆ hasConditionalTerminator()

static bool hasConditionalTerminator ( const VPBasicBlock VPBB)
static

◆ remapOperands()

static void remapOperands ( VPBlockBase Entry,
VPBlockBase NewEntry,
DenseMap< VPValue *, VPValue * > &  Old2NewVPValues 
)
static

◆ replaceVPBBWithIRVPBB()

static void replaceVPBBWithIRVPBB ( VPBasicBlock VPBB,
BasicBlock IRBB 
)
static

Replace VPBB with a VPIRBasicBlock wrapping IRBB.

All recipes from VPBB are moved to the end of the newly created VPIRBasicBlock. VPBB must have a single predecessor, which is rewired to the new VPIRBasicBlock. All successors of VPBB, if any, are rewired to the new VPIRBasicBlock.

Definition at line 962 of file VPlan.cpp.

References assert(), llvm::VPBasicBlock::end(), llvm::VPIRBasicBlock::fromBasicBlock(), llvm::make_early_inc_range(), and llvm::VPBlockUtils::reassociateBlocks().

Referenced by llvm::VPlan::execute().

Variable Documentation

◆ ForceTargetInstructionCost

cl::opt<unsigned> ForceTargetInstructionCost
extern

◆ PrintVPlansInDotFormat

cl::opt< bool > PrintVPlansInDotFormat("vplan-print-in-dot-format", cl::Hidden, cl::desc("Use dot format instead of plain text when dumping VPlans")) ( "vplan-print-in-dot-format"  ,
cl::Hidden  ,
cl::desc("Use dot format instead of plain text when dumping VPlans")   
)
static