LLVM API Documentation
Go to the source code of this file.
Functions | |
static bool | CheapToScalarize (Value *V, bool isConstant) |
static Value * | FindScalarElement (Value *V, unsigned EltNo) |
static bool | CollectSingleShuffleElements (Value *V, Value *LHS, Value *RHS, SmallVectorImpl< Constant * > &Mask) |
static Value * | CollectShuffleElements (Value *V, SmallVectorImpl< Constant * > &Mask, Value *&RHS) |
static bool | CanEvaluateShuffled (Value *V, ArrayRef< int > Mask, unsigned Depth=5) |
static Value * | BuildNew (Instruction *I, ArrayRef< Value * > NewOps) |
|
static |
Rebuild a new instruction just like 'I' but with the new operands given. In the event of type mismatch, the type of the operands is correct.
Definition at line 607 of file InstCombineVectorOps.cpp.
References llvm::APIntOps::And(), llvm::BinaryOperator::Create(), llvm::CastInst::Create(), llvm::GetElementPtrInst::Create(), llvm::VectorType::get(), llvm::Instruction::getOpcode(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::BinaryOperator::hasNoSignedWrap(), llvm::BinaryOperator::hasNoUnsignedWrap(), I, llvm::BinaryOperator::isExact(), llvm_unreachable, llvm::APIntOps::Or(), llvm::GetElementPtrInst::setIsInBounds(), llvm::ArrayRef< T >::size(), llvm::ArrayRef< T >::slice(), and llvm::APIntOps::Xor().
Return true if we can evaluate the specified expression tree if the vector elements were shuffled in a different order.
Definition at line 531 of file InstCombineVectorOps.cpp.
References llvm::APIntOps::And(), llvm::dyn_cast(), llvm::ConstantInt::getLimitedValue(), llvm::User::getNumOperands(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::hasOneUse(), I, llvm::APIntOps::Or(), llvm::ArrayRef< T >::size(), and llvm::APIntOps::Xor().
Referenced by llvm::InstCombiner::visitShuffleVectorInst().
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 |
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 |
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().
FindScalarElement - Given a vector and an element number, see if the scalar value is already around as a register, for example if it were inserted then extracted from the vector.
Definition at line 61 of file InstCombineVectorOps.cpp.
References llvm::CallingConv::C, llvm::UndefValue::get(), llvm::Constant::getAggregateElement(), llvm::VectorType::getNumElements(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::Constant::isNullValue(), llvm::Type::isVectorTy(), llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_Value(), and llvm::PatternMatch::match().
Referenced by llvm::InstCombiner::visitExtractElementInst().