LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
InstCombineVectorOps.cpp File Reference
#include "InstCombine.h"
#include "llvm/Support/PatternMatch.h"
Include dependency graph for InstCombineVectorOps.cpp:

Go to the source code of this file.

Functions

static bool CheapToScalarize (Value *V, bool isConstant)
 
static ValueFindScalarElement (Value *V, unsigned EltNo)
 
static bool CollectSingleShuffleElements (Value *V, Value *LHS, Value *RHS, SmallVectorImpl< Constant * > &Mask)
 
static ValueCollectShuffleElements (Value *V, SmallVectorImpl< Constant * > &Mask, Value *&RHS)
 
static bool CanEvaluateShuffled (Value *V, ArrayRef< int > Mask, unsigned Depth=5)
 
static ValueBuildNew (Instruction *I, ArrayRef< Value * > NewOps)
 

Function Documentation

static Value* BuildNew ( Instruction I,
ArrayRef< Value * >  NewOps 
)
static
static bool CanEvaluateShuffled ( Value V,
ArrayRef< int >  Mask,
unsigned  Depth = 5 
)
static
static bool CheapToScalarize ( Value V,
bool  isConstant 
)
static

CheapToScalarize - Return true if the value is cheaper to scalarize than it is to leave as a vector operation. isConstant indicates whether we're extracting one known element. If false we're extracting a variable index.

Definition at line 23 of file InstCombineVectorOps.cpp.

References llvm::CallingConv::C, llvm::dyn_cast(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::Value::hasOneUse(), I, and llvm::SPII::Load.

Referenced by llvm::InstCombiner::visitExtractElementInst().

static Value* CollectShuffleElements ( Value V,
SmallVectorImpl< Constant * > &  Mask,
Value *&  RHS 
)
static

CollectShuffleElements - We are building a shuffle of V, using RHS as the RHS of the shuffle instruction, if it is not null. Return a shuffle mask that computes V and the LHS value of the shuffle.

Definition at line 403 of file InstCombineVectorOps.cpp.

References llvm::SmallVectorImpl< T >::assign(), CollectSingleShuffleElements(), llvm::ConstantInt::get(), llvm::UndefValue::get(), llvm::Value::getContext(), llvm::Type::getInt32Ty(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::isVectorTy(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().

Referenced by llvm::InstCombiner::visitInsertElementInst().

static bool CollectSingleShuffleElements ( Value V,
Value LHS,
Value RHS,
SmallVectorImpl< Constant * > &  Mask 
)
static

CollectSingleShuffleElements - If V is a shuffle of values that ONLY returns elements from either LHS or RHS, return the shuffle mask and true. Otherwise, return false.

Definition at line 325 of file InstCombineVectorOps.cpp.

References llvm::SmallVectorImpl< T >::assign(), llvm::ConstantInt::get(), llvm::UndefValue::get(), llvm::Value::getContext(), llvm::Type::getInt32Ty(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().

Referenced by CollectShuffleElements().

static Value* FindScalarElement ( Value V,
unsigned  EltNo 
)
static