LLVM 20.0.0git
|
This file contains implementations for different VPlan recipes. More...
#include "VPlan.h"
#include "VPlanAnalysis.h"
#include "VPlanPatternMatch.h"
#include "VPlanUtils.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Analysis/IVDescriptors.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/IR/VectorBuilder.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include <cassert>
Go to the source code of this file.
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Macros | |
#define | LV_NAME "loop-vectorize" |
#define | DEBUG_TYPE LV_NAME |
Typedefs | |
using | VectorParts = SmallVector< Value *, 2 > |
Functions | |
static Value * | getStepVector (Value *Val, Value *Step, Instruction::BinaryOps BinOp, ElementCount VF, IRBuilderBase &Builder) |
This function adds (0 * Step, 1 * Step, 2 * Step, ...) to each vector element of Val. | |
static Constant * | getSignedIntOrFpConstant (Type *Ty, int64_t C) |
A helper function that returns an integer or floating-point constant with value C. | |
static Type * | getGEPIndexTy (bool IsScalable, bool IsReverse, unsigned CurrentPart, IRBuilderBase &Builder) |
static Instruction * | createReverseEVL (IRBuilderBase &Builder, Value *Operand, Value *EVL, const Twine &Name) |
Use all-true mask for reverse rather than actual mask, as it avoids a dependence w/o affecting the result. | |
static Value * | createBitOrPointerCast (IRBuilderBase &Builder, Value *V, VectorType *DstVTy, const DataLayout &DL) |
static Value * | interleaveVectors (IRBuilderBase &Builder, ArrayRef< Value * > Vals, const Twine &Name) |
Return a vector containing interleaved elements from multiple smaller input vectors. | |
Variables | |
cl::opt< unsigned > | ForceTargetInstructionCost |
This file contains implementations for different VPlan recipes.
Definition in file VPlanRecipes.cpp.
#define DEBUG_TYPE LV_NAME |
Definition at line 49 of file VPlanRecipes.cpp.
#define LV_NAME "loop-vectorize" |
Definition at line 48 of file VPlanRecipes.cpp.
using VectorParts = SmallVector<Value *, 2> |
Definition at line 41 of file VPlanRecipes.cpp.
|
static |
Definition at line 2806 of file VPlanRecipes.cpp.
References assert(), llvm::IRBuilderBase::CreateBitOrPointerCast(), DL, llvm::VectorType::get(), llvm::Type::getIntNTy(), llvm::CastInst::isBitOrNoopPointerCastable(), llvm::Type::isFloatingPointTy(), and llvm::Type::isPointerTy().
Referenced by llvm::VPInterleaveRecipe::execute().
|
static |
Use all-true mask for reverse rather than actual mask, as it avoids a dependence w/o affecting the result.
Definition at line 2602 of file VPlanRecipes.cpp.
References llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateVectorSplat(), llvm::IRBuilderBase::getTrue(), llvm::Value::getType(), and Name.
Referenced by llvm::VPWidenLoadEVLRecipe::execute(), and llvm::VPWidenStoreEVLRecipe::execute().
|
static |
Definition at line 2022 of file VPlanRecipes.cpp.
References DL, llvm::BasicBlock::getDataLayout(), llvm::IRBuilderBase::GetInsertBlock(), llvm::IRBuilderBase::getInt32Ty(), and llvm::IRBuilderBase::getPtrTy().
Referenced by llvm::VPReverseVectorPointerRecipe::execute(), and llvm::VPVectorPointerRecipe::execute().
A helper function that returns an integer or floating-point constant with value C.
Definition at line 1707 of file VPlanRecipes.cpp.
References llvm::CallingConv::C, llvm::ConstantInt::getSigned(), and llvm::Type::isIntegerTy().
Referenced by llvm::VPScalarIVStepsRecipe::execute().
|
static |
This function adds (0 * Step, 1 * Step, 2 * Step, ...) to each vector element of Val.
Opcode
is relevant for FP induction variable.
Definition at line 1661 of file VPlanRecipes.cpp.
References assert(), llvm::IRBuilderBase::CreateAdd(), llvm::IRBuilderBase::CreateBinOp(), llvm::IRBuilderBase::CreateFMul(), llvm::IRBuilderBase::CreateMul(), llvm::IRBuilderBase::CreateStepVector(), llvm::IRBuilderBase::CreateUIToFP(), llvm::IRBuilderBase::CreateVectorSplat(), llvm::IntegerType::get(), llvm::VectorType::get(), llvm::Type::getContext(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::Type::isFloatingPointTy(), llvm::Type::isIntegerTy(), and llvm::ElementCount::isVector().
Referenced by llvm::VPWidenIntOrFpInductionRecipe::execute().
|
static |
Return a vector containing interleaved elements from multiple smaller input vectors.
Definition at line 2838 of file VPlanRecipes.cpp.
References assert(), llvm::concatenateVectors(), llvm::createInterleaveMask(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilderBase::CreateShuffleVector(), llvm::VectorType::getDoubleElementsVectorType(), getType(), Name, and llvm::ArrayRef< T >::size().
Referenced by llvm::VPInterleaveRecipe::execute().