LLVM: llvm::sandboxir::VecUtils Class Reference (original) (raw)
#include "[llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h](VecUtils%5F8h%5Fsource.html)"
| Static Public Member Functions | |
|---|---|
| static int | getNumElements (Type *Ty) |
| \Returns the number of elements in Ty. | |
| static Type * | getElementType (Type *Ty) |
| Returns Ty if scalar or its element type if vector. | |
| template | |
| static bool | areConsecutive (LoadOrStoreT *I1, LoadOrStoreT *I2, ScalarEvolution &SE, const DataLayout &DL) |
| \Returns true if I1 and I2 are load/stores accessing consecutive memory addresses. | |
| template | |
| static bool | areConsecutive (ArrayRef< Value * > &Bndl, ScalarEvolution &SE, const DataLayout &DL) |
| static unsigned | getNumLanes (Type *Ty) |
| \Returns the number of vector lanes of Ty or 1 if not a vector. | |
| static unsigned | getNumLanes (Value *V) |
| \Returns the expected vector lanes of V or 1 if not a vector. | |
| static unsigned | getNumLanes (ArrayRef< Value * > Bndl) |
| \Returns the total number of lanes across all values in Bndl. | |
| static Type * | getWideType (Type *ElemTy, unsigned NumElts) |
| \Returns . | |
| static Instruction * | getLowest (ArrayRef< Instruction * > Instrs) |
| \Returns the instruction in Instrs that is lowest in the BB. | |
| static Instruction * | getLowest (ArrayRef< Value * > Vals, BasicBlock *BB) |
| \Returns the lowest instruction in Vals, or nullptr if no instructions are found. | |
| static Instruction * | getLastPHIOrSelf (Instruction *I) |
| If I is not a PHI it returns it. | |
| static Type * | tryGetCommonScalarType (ArrayRef< Value * > Bndl) |
| If all values in Bndl are of the same scalar type then return it, otherwise return nullptr. | |
| static Type * | getCommonScalarType (ArrayRef< Value * > Bndl) |
| Similar to tryGetCommonScalarType() but will assert that there is a common type. | |
| static LLVM_ABI unsigned | getFloorPowerOf2 (unsigned Num) |
| \Returns the first integer power of 2 that is <= Num. | |
| static std::optional< PackPattern > | matchPack (Instruction *I) |
| If I is the last instruction of a pack pattern (i.e., an InsertElement into a vector), then this function returns the instructions in the pack and the operands in the pack, else returns nullopt. | |
| static LLVM_DUMP_METHOD void | dump (ArrayRef< Value * > Bndl) |
| Helper dump function for debugging. | |
| static LLVM_DUMP_METHOD void | dump (ArrayRef< Instruction * > Bndl) |
Definition at line 41 of file VecUtils.h.
◆ areConsecutive() [1/2]
template
◆ areConsecutive() [2/2]
template
◆ dump() [1/2]
◆ dump() [2/2]
| void llvm::sandboxir::VecUtils::dump ( ArrayRef< Value * > Bndl) | static |
|---|
◆ getCommonScalarType()
| Type * llvm::sandboxir::VecUtils::getCommonScalarType ( ArrayRef< Value * > Bndl) | inlinestatic |
|---|
◆ getElementType()
| Type * llvm::sandboxir::VecUtils::getElementType ( Type * Ty) | inlinestatic |
|---|
◆ getFloorPowerOf2()
◆ getLastPHIOrSelf()
◆ getLowest() [1/2]
◆ getLowest() [2/2]
◆ getNumElements()
| int llvm::sandboxir::VecUtils::getNumElements ( Type * Ty) | inlinestatic |
|---|
\Returns the number of elements in Ty.
That is the number of lanes if a fixed vector or 1 if scalar. ScalableVectors have unknown size and therefore are unsupported.
Definition at line 46 of file VecUtils.h.
References assert(), llvm::cast(), and llvm::isa().
◆ getNumLanes() [1/3]
\Returns the total number of lanes across all values in Bndl.
Definition at line 105 of file VecUtils.h.
References getNumLanes().
◆ getNumLanes() [2/3]
| unsigned llvm::sandboxir::VecUtils::getNumLanes ( Type * Ty) | inlinestatic |
|---|
◆ getNumLanes() [3/3]
| unsigned llvm::sandboxir::VecUtils::getNumLanes ( Value * V) | inlinestatic |
|---|
◆ getWideType()
| Type * llvm::sandboxir::VecUtils::getWideType ( Type * ElemTy, unsigned NumElts ) | inlinestatic |
|---|
◆ matchPack()
If I is the last instruction of a pack pattern (i.e., an InsertElement into a vector), then this function returns the instructions in the pack and the operands in the pack, else returns nullopt.
Here is an example of a matched pattern: PackA0 = insertelement <2 x i8> poison, i8 v0, i64 0 PackA1 = insertelement <2 x i8> PackA0, i8 v1, i64 1 TODO: this currently detects only simple canonicalized patterns.
Definition at line 226 of file VecUtils.h.
References assert(), llvm::dyn_cast(), getNumLanes(), llvm::sandboxir::User::getOperand(), llvm::sandboxir::Instruction::getParent(), I, llvm::isa(), llvm::reverse(), and llvm::seq().
Referenced by llvm::sandboxir::PackReuse::runOnRegion().
◆ tryGetCommonScalarType()
| Type * llvm::sandboxir::VecUtils::tryGetCommonScalarType ( ArrayRef< Value * > Bndl) | inlinestatic |
|---|
The documentation for this class was generated from the following files:
- include/llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h
- lib/Transforms/Vectorize/SandboxVectorizer/VecUtils.cpp