LLVM 17.0.0git
Functions
VPlanTransforms.cpp File Reference

This file implements a set of utility VPlan to VPlan transformations. More...

#include "VPlanTransforms.h"
#include "VPlanDominatorTree.h"
#include "VPRecipeBuilder.h"
#include "VPlanCFG.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/IVDescriptors.h"
#include "llvm/Analysis/VectorUtils.h"
#include "llvm/IR/Intrinsics.h"

Go to the source code of this file.

Functions

static bool sinkScalarOperands (VPlan &Plan)
 
VPValuegetPredicatedMask (VPRegionBlock *R)
 If R is a region with a VPBranchOnMaskRecipe in the entry block, return the mask.
 
static VPBasicBlockgetPredicatedThenBlock (VPRegionBlock *R)
 If R is a triangle region, return the 'then' block of the triangle.
 
static bool mergeReplicateRegionsIntoSuccessors (VPlan &Plan)
 
static VPRegionBlockcreateReplicateRegion (VPReplicateRecipe *PredRecipe, VPlan &Plan)
 
static void addReplicateRegions (VPlan &Plan)
 
static bool canSimplifyBranchOnCond (VPInstruction *Term)
 
static VPRegionBlockGetReplicateRegion (VPRecipeBase *R)
 
static bool properlyDominates (const VPRecipeBase *A, const VPRecipeBase *B, VPDominatorTree &VPDT)
 
static bool sinkRecurrenceUsersAfterPrevious (VPFirstOrderRecurrencePHIRecipe *FOR, VPRecipeBase *Previous, VPDominatorTree &VPDT)
 Sink users of FOR after the recipe defining the previous value Previous of the recurrence.
 

Detailed Description

This file implements a set of utility VPlan to VPlan transformations.

Definition in file VPlanTransforms.cpp.

Function Documentation

◆ addReplicateRegions()

static void addReplicateRegions ( VPlan Plan)
static

◆ canSimplifyBranchOnCond()

static bool canSimplifyBranchOnCond ( VPInstruction Term)
static

◆ createReplicateRegion()

static VPRegionBlock * createReplicateRegion ( VPReplicateRecipe PredRecipe,
VPlan Plan 
)
static

◆ getPredicatedMask()

VPValue * getPredicatedMask ( VPRegionBlock R)

If R is a region with a VPBranchOnMaskRecipe in the entry block, return the mask.

Definition at line 184 of file VPlanTransforms.cpp.

Referenced by mergeReplicateRegionsIntoSuccessors().

◆ getPredicatedThenBlock()

static VPBasicBlock * getPredicatedThenBlock ( VPRegionBlock R)
static

If R is a triangle region, return the 'then' block of the triangle.

Definition at line 194 of file VPlanTransforms.cpp.

Referenced by mergeReplicateRegionsIntoSuccessors().

◆ GetReplicateRegion()

static VPRegionBlock * GetReplicateRegion ( VPRecipeBase R)
static

Definition at line 606 of file VPlanTransforms.cpp.

References assert().

Referenced by properlyDominates().

◆ mergeReplicateRegionsIntoSuccessors()

static bool mergeReplicateRegionsIntoSuccessors ( VPlan Plan)
static

◆ properlyDominates()

static bool properlyDominates ( const VPRecipeBase A,
const VPRecipeBase B,
VPDominatorTree VPDT 
)
static

◆ sinkRecurrenceUsersAfterPrevious()

static bool sinkRecurrenceUsersAfterPrevious ( VPFirstOrderRecurrencePHIRecipe FOR,
VPRecipeBase Previous,
VPDominatorTree VPDT 
)
static

Sink users of FOR after the recipe defining the previous value Previous of the recurrence.

Returns
true if all users of FOR could be re-arranged as needed or false if it is not possible.

Definition at line 650 of file VPlanTransforms.cpp.

References A, assert(), B, llvm::VPDef::getNumDefinedValues(), llvm::VPDef::getVPSingleValue(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), properlyDominates(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorBase< Size_T >::size(), llvm::sort(), and llvm::VPValue::users().

Referenced by llvm::VPlanTransforms::adjustFixedOrderRecurrences().

◆ sinkScalarOperands()

static bool sinkScalarOperands ( VPlan Plan)
static