LLVM 22.0.0git
ExpandVectorPredication.cpp File Reference

Go to the source code of this file.

Macros

#define VPINTERNAL_VPLEGAL_CASES
#define VPINTERNAL_CASE(X)
#define VPINTERNAL_CASE(X)
#define DEBUG_TYPE   "expandvp"

Typedefs

using VPLegalization = TargetTransformInfo::VPLegalization
using VPTransform = TargetTransformInfo::VPLegalization::VPTransform

Functions

static VPTransform parseOverrideOption (const std::string &TextOpt)
static bool anyExpandVPOverridesSet ()
 STATISTIC (NumFoldedVL, "Number of folded vector length params")
 STATISTIC (NumLoweredVPOps, "Number of folded vector predication operations")
static bool isAllTrueMask (Value *MaskVal)
static ConstantgetSafeDivisor (Type *DivTy)
static void transferDecorations (Value &NewVal, VPIntrinsic &VPI)
 Transfer operation properties from OldVPI to NewVal.
static void replaceOperation (Value &NewOp, VPIntrinsic &OldOp)
 Transfer all properties from OldOp to NewOp and replace all uses.
static bool maySpeculateLanes (VPIntrinsic &VPI)

Variables

static cl::opt< std::stringEVLTransformOverride ("expandvp-override-evl-transform", cl::init(""), cl::Hidden, cl::desc("Options: <empty>" VPINTERNAL_VPLEGAL_CASES ". If non-empty, ignore " "TargetTransformInfo and " "always use this transformation for the %evl parameter (Used in " "testing)."))
static cl::opt< std::stringMaskTransformOverride ("expandvp-override-mask-transform", cl::init(""), cl::Hidden, cl::desc("Options: <empty>" VPINTERNAL_VPLEGAL_CASES ". If non-empty, Ignore " "TargetTransformInfo and " "always use this transformation for the %mask parameter (Used in " "testing)."))

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "expandvp"

Definition at line 75 of file ExpandVectorPredication.cpp.

◆ VPINTERNAL_CASE [1/2]

#define VPINTERNAL_CASE ( X)
Value:
"|" #X
static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")

Definition at line 42 of file ExpandVectorPredication.cpp.

◆ VPINTERNAL_CASE [2/2]

#define VPINTERNAL_CASE ( X)
Value:
.Case(#X, VPLegalization::X)

Definition at line 42 of file ExpandVectorPredication.cpp.

◆ VPINTERNAL_VPLEGAL_CASES

#define VPINTERNAL_VPLEGAL_CASES
Value:
VPINTERNAL_CASE(Discard) \
VPINTERNAL_CASE(Convert)
#define VPINTERNAL_CASE(X)

Definition at line 37 of file ExpandVectorPredication.cpp.

Referenced by parseOverrideOption().

Typedef Documentation

◆ VPLegalization

◆ VPTransform

Function Documentation

◆ anyExpandVPOverridesSet()

bool anyExpandVPOverridesSet ( )
static

Definition at line 71 of file ExpandVectorPredication.cpp.

References EVLTransformOverride, and MaskTransformOverride.

◆ getSafeDivisor()

Constant * getSafeDivisor ( Type * DivTy)
static
Returns
A non-excepting divisor constant for this type.

Definition at line 92 of file ExpandVectorPredication.cpp.

References assert(), and llvm::Type::isIntOrIntVectorTy().

◆ isAllTrueMask()

bool isAllTrueMask ( Value * MaskVal)
static
Returns
Whether the vector mask MaskVal has all lane bits set.

Definition at line 83 of file ExpandVectorPredication.cpp.

References llvm::dyn_cast(), and llvm::getSplatValue().

◆ maySpeculateLanes()

◆ parseOverrideOption()

VPTransform parseOverrideOption ( const std::string & TextOpt)
static

Definition at line 64 of file ExpandVectorPredication.cpp.

References VPINTERNAL_VPLEGAL_CASES.

◆ replaceOperation()

void replaceOperation ( Value & NewOp,
VPIntrinsic & OldOp )
static

Transfer all properties from OldOp to NewOp and replace all uses.

OldVP gets erased.

Definition at line 112 of file ExpandVectorPredication.cpp.

References llvm::Instruction::eraseFromParent(), llvm::Value::hasName(), llvm::isa(), llvm::Value::replaceAllUsesWith(), llvm::Value::takeName(), and transferDecorations().

◆ STATISTIC() [1/2]

STATISTIC ( NumFoldedVL ,
"Number of folded vector length params"  )

◆ STATISTIC() [2/2]

STATISTIC ( NumLoweredVPOps ,
"Number of folded vector predication operations"  )

◆ transferDecorations()

void transferDecorations ( Value & NewVal,
VPIntrinsic & VPI )
static

Transfer operation properties from OldVPI to NewVal.

Definition at line 98 of file ExpandVectorPredication.cpp.

References llvm::dyn_cast(), and llvm::isa().

Referenced by replaceOperation().

Variable Documentation

◆ EVLTransformOverride

cl::opt< std::string > EVLTransformOverride("expandvp-override-evl-transform", cl::init(""), cl::Hidden, cl::desc("Options: <empty>" VPINTERNAL_VPLEGAL_CASES ". If non-empty, ignore " "TargetTransformInfo and " "always use this transformation for the %evl parameter (Used in " "testing).")) ( "expandvp-override-evl-transform" ,
cl::init("") ,
cl::Hidden ,
cl::desc("Options: <empty>" VPINTERNAL_VPLEGAL_CASES ". If non-empty, ignore " "TargetTransformInfo and " "always use this transformation for the %evl parameter (Used in " "testing).")  )
static

Referenced by anyExpandVPOverridesSet().

◆ MaskTransformOverride

cl::opt< std::string > MaskTransformOverride("expandvp-override-mask-transform", cl::init(""), cl::Hidden, cl::desc("Options: <empty>" VPINTERNAL_VPLEGAL_CASES ". If non-empty, Ignore " "TargetTransformInfo and " "always use this transformation for the %mask parameter (Used in " "testing).")) ( "expandvp-override-mask-transform" ,
cl::init("") ,
cl::Hidden ,
cl::desc("Options: <empty>" VPINTERNAL_VPLEGAL_CASES ". If non-empty, Ignore " "TargetTransformInfo and " "always use this transformation for the %mask parameter (Used in " "testing).")  )
static

Referenced by anyExpandVPOverridesSet().