|
LLVM
3.7.0
|
#include "InstCombineInternal.h"#include "llvm/ADT/DenseMap.h"#include "llvm/Analysis/InstructionSimplify.h"#include "llvm/Analysis/VectorUtils.h"#include "llvm/IR/PatternMatch.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "instcombine" |
Typedefs | |
| typedef std::pair< Value *, Value * > | ShuffleOps |
| We are building a shuffle to create V, which is a sequence of insertelement, extractelement pairs. More... | |
Functions | |
| static bool | CheapToScalarize (Value *V, bool isConstant) |
| CheapToScalarize - Return true if the value is cheaper to scalarize than it is to leave as a vector operation. More... | |
| static bool | CollectSingleShuffleElements (Value *V, Value *LHS, Value *RHS, SmallVectorImpl< Constant * > &Mask) |
| CollectSingleShuffleElements - If V is a shuffle of values that ONLY returns elements from either LHS or RHS, return the shuffle mask and true. More... | |
| static ShuffleOps | CollectShuffleElements (Value *V, SmallVectorImpl< Constant * > &Mask, Value *PermittedRHS) |
| static bool | CanEvaluateShuffled (Value *V, ArrayRef< int > Mask, unsigned Depth=5) |
| Return true if we can evaluate the specified expression tree if the vector elements were shuffled in a different order. More... | |
| static Value * | BuildNew (Instruction *I, ArrayRef< Value * > NewOps) |
| Rebuild a new instruction just like 'I' but with the new operands given. More... | |
| static void | RecognizeIdentityMask (const SmallVectorImpl< int > &Mask, bool &isLHSID, bool &isRHSID) |
| static bool | isShuffleExtractingFromLHS (ShuffleVectorInst &SVI, SmallVector< int, 16 > &Mask) |
| #define DEBUG_TYPE "instcombine" |
Definition at line 23 of file InstCombineVectorOps.cpp.
| typedef std::pair<Value *, Value *> ShuffleOps |
We are building a shuffle to create V, which is a sequence of insertelement, extractelement pairs.
If PermittedRHS is set, then we must either use it or not rely on the second vector source. Return a std::pair containing the left and right vectors of the proposed shuffle (or 0), and set the Mask parameter as required.
Note: we intentionally don't try to fold earlier shuffles since they have often been chosen carefully to be efficiently implementable on the target.
Definition at line 364 of file InstCombineVectorOps.cpp.
|
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 620 of file InstCombineVectorOps.cpp.
References llvm::APIntOps::And(), llvm::BinaryOperator::Create(), llvm::CastInst::Create(), llvm::GetElementPtrInst::Create(), GEP, 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 544 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 28 of file InstCombineVectorOps.cpp.
References 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 |
Definition at line 366 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::getVectorNumElements(), 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 281 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 |
Definition at line 815 of file InstCombineVectorOps.cpp.
References llvm::SmallVectorTemplateCommon< T >::back(), llvm::SmallVectorTemplateCommon< T >::front(), llvm::User::getOperand(), llvm::Value::getType(), I, and llvm::SmallVectorTemplateCommon< T >::size().
Referenced by llvm::InstCombiner::visitShuffleVectorInst().
|
static |
Definition at line 795 of file InstCombineVectorOps.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by llvm::InstCombiner::visitShuffleVectorInst().
1.8.6