LLVM 20.0.0git
|
#include "llvm/Transforms/Vectorize/SandboxVectorizer/VecUtils.h"
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<typename LoadOrStoreT > | |
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<typename LoadOrStoreT > | |
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 <NumElts x ElemTy>. | |
static Instruction * | getLowest (ArrayRef< Instruction * > Instrs) |
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. | |
Definition at line 22 of file VecUtils.h.
|
inlinestatic |
Definition at line 52 of file VecUtils.h.
References areConsecutive(), assert(), DL, and llvm::drop_begin().
|
inlinestatic |
\Returns true if I1
and I2
are load/stores accessing consecutive memory addresses.
Definition at line 39 of file VecUtils.h.
References llvm::sandboxir::Utils::getNumBits(), and llvm::sandboxir::Utils::getPointerDiffInBytes().
Referenced by areConsecutive().
|
inlinestatic |
Similar to tryGetCommonScalarType() but will assert that there is a common type.
So this is faster in release builds as it won't iterate through the values.
Definition at line 129 of file VecUtils.h.
References assert(), getElementType(), llvm::sandboxir::Utils::getExpectedType(), and tryGetCommonScalarType().
Returns Ty
if scalar or its element type if vector.
Definition at line 32 of file VecUtils.h.
References llvm::sandboxir::Type::isVectorTy().
Referenced by getCommonScalarType(), and tryGetCommonScalarType().
|
inlinestatic |
Definition at line 103 of file VecUtils.h.
References llvm::sandboxir::Instruction::comesBefore(), llvm::drop_begin(), llvm::ArrayRef< T >::front(), and I.
Referenced by llvm::sandboxir::Scheduler::trySchedule().
|
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 27 of file VecUtils.h.
References assert(), and llvm::sandboxir::Type::isVectorTy().
\Returns the total number of lanes across all values in Bndl
.
Definition at line 86 of file VecUtils.h.
References getNumLanes().
\Returns the number of vector lanes of Ty
or 1 if not a vector.
NOTE: It asserts that Ty
is a fixed vector type.
Definition at line 72 of file VecUtils.h.
References assert().
Referenced by getNumLanes().
\Returns the expected vector lanes of V
or 1 if not a vector.
NOTE: It asserts that V
is a fixed vector.
Definition at line 81 of file VecUtils.h.
References llvm::sandboxir::Utils::getExpectedType(), and getNumLanes().
|
inlinestatic |
\Returns <NumElts x ElemTy>.
It works for both scalar and vector ElemTy
.
Definition at line 95 of file VecUtils.h.
References llvm::sandboxir::FixedVectorType::get(), and llvm::sandboxir::Type::isVectorTy().
|
inlinestatic |
If all values in Bndl
are of the same scalar type then return it, otherwise return nullptr.
Definition at line 113 of file VecUtils.h.
References llvm::drop_begin(), getElementType(), and llvm::sandboxir::Utils::getExpectedType().
Referenced by getCommonScalarType().