LLVM  8.0.0svn
Macros | Functions | Variables
LoadStoreVectorizer.cpp File Reference
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/Analysis/OrderedBasicBlock.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Analysis/VectorUtils.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Vectorize.h"
#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <tuple>
#include <utility>
Include dependency graph for LoadStoreVectorizer.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "load-store-vectorizer"
 

Functions

 STATISTIC (NumVectorInstructions, "Number of vector accesses generated")
 
 STATISTIC (NumScalarsVectorized, "Number of scalar accesses vectorized")
 
 INITIALIZE_PASS_BEGIN (LoadStoreVectorizer, DEBUG_TYPE, "Vectorize load and Store instructions", false, false) INITIALIZE_PASS_END(LoadStoreVectorizer
 
static void propagateMetadata (Instruction *I, ArrayRef< Instruction *> IL)
 
static ChainID getChainID (const Value *Ptr, const DataLayout &DL)
 

Variables

static const unsigned StackAdjustedAlignment = 4
 
 DEBUG_TYPE
 
Vectorize load and store instructions
 
Vectorize load and store false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "load-store-vectorizer"

Definition at line 90 of file LoadStoreVectorizer.cpp.

Function Documentation

◆ getChainID()

static ChainID getChainID ( const Value Ptr,
const DataLayout DL 
)
static

Definition at line 694 of file LoadStoreVectorizer.cpp.

References llvm::abs(), llvm::all_of(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::MCID::Bitcast, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::dbgs(), llvm::Value::dump(), llvm::dyn_cast(), E, llvm::ArrayRef< T >::empty(), llvm::Instruction::eraseFromParent(), llvm::CallingConv::Fast, llvm::ArrayRef< T >::front(), llvm::VectorType::get(), llvm::UndefValue::get(), getAlignment(), llvm::Module::getContext(), llvm::Type::getIntNTy(), llvm::Value::getName(), llvm::SequentialType::getNumElements(), llvm::User::getOperand(), llvm::getOrEnforceKnownAlignment(), llvm::GlobalValue::getParent(), llvm::LoadInst::getPointerAddressSpace(), llvm::Type::getPointerAddressSpace(), llvm::StoreInst::getPointerAddressSpace(), llvm::LoadInst::getPointerOperand(), llvm::StoreInst::getPointerOperand(), llvm::Type::getScalarType(), getType(), llvm::Value::getType(), llvm::GetUnderlyingObject(), llvm::StoreInst::getValueOperand(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::is_contained(), llvm::isConsecutiveAccess(), llvm::isPowerOf2_32(), llvm::Type::isPtrOrPtrVectorTy(), llvm::VectorType::isValidElementType(), llvm::Type::isVectorTy(), LLVM_DEBUG, llvm::Instruction::mayReadOrWriteMemory(), llvm::AArch64CC::NE, llvm::propagateMetadata(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Value::replaceAllUsesWith(), SI, Size, llvm::ArrayRef< T >::size(), StackAdjustedAlignment, llvm::SPII::Store, and users.

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( LoadStoreVectorizer  ,
DEBUG_TYPE  ,
"Vectorize load and Store instructions ,
false  ,
false   
)

◆ propagateMetadata()

static void propagateMetadata ( Instruction I,
ArrayRef< Instruction *>  IL 
)
static

Definition at line 251 of file LoadStoreVectorizer.cpp.

References llvm::MCID::Add, assert(), B, llvm::SmallVectorTemplateCommon< T >::begin(), llvm::ArrayRef< T >::begin(), C, llvm::APInt::clearBit(), llvm::computeKnownBits(), llvm::dbgs(), llvm::Depth, llvm::OrderedBasicBlock::dominates(), llvm::dyn_cast(), E, llvm::SmallVectorBase::empty(), llvm::ArrayRef< T >::end(), llvm::BasicBlock::end(), llvm::Instruction::eraseFromParent(), F(), GEP, llvm::gep_type_begin(), llvm::MemoryLocation::get(), llvm::APInt::getBitWidth(), llvm::generic_gep_type_iterator< ItTy >::getIndexedType(), getIntrinsicID(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::getLoadStorePointerOperand(), llvm::Instruction::getMetadata(), llvm::User::getNumOperands(), llvm::Instruction::getOpcode(), llvm::generic_gep_type_iterator< ItTy >::getOperand(), llvm::User::getOperand(), llvm::Instruction::getParent(), getParent(), llvm::Type::getPointerElementType(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::Value::getType(), llvm::Function::hasFnAttribute(), I, llvm::Instruction::insertBefore(), llvm::is_contained(), llvm::isConsecutiveAccess(), llvm::APInt::isMinSignedValue(), llvm::APInt::isNegative(), llvm::Type::isVectorTy(), LLVM_DEBUG, llvm::make_range(), MaxDepth, llvm::Instruction::mayReadOrWriteMemory(), llvm::Instruction::mayThrow(), llvm::Instruction::mayWriteToMemory(), llvm::LLVMContext::MD_invariant_load, llvm::APInt::negate(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::post_order(), llvm::propagateMetadata(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Instruction::removeFromParent(), runOnFunction(), Signed, Size, llvm::SmallVectorBase::size(), llvm::ArrayRef< T >::size(), llvm::APInt::sle(), llvm::ArrayRef< T >::slice(), llvm::Value::stripAndAccumulateInBoundsConstantOffsets(), std::swap(), llvm::APInt::trunc(), llvm::APInt::udiv(), llvm::APInt::ult(), llvm::APInt::urem(), llvm::Value::use_empty(), X, llvm::KnownBits::Zero, llvm::APInt::zext(), and llvm::APInt::zextOrSelf().

◆ STATISTIC() [1/2]

STATISTIC ( NumVectorInstructions  ,
"Number of vector accesses generated"   
)

◆ STATISTIC() [2/2]

STATISTIC ( NumScalarsVectorized  ,
"Number of scalar accesses vectorized"   
)

Variable Documentation

◆ DEBUG_TYPE

DEBUG_TYPE

Definition at line 242 of file LoadStoreVectorizer.cpp.

◆ false

Vectorize load and store false

Definition at line 242 of file LoadStoreVectorizer.cpp.

◆ instructions

Vectorize load and store instructions

Definition at line 242 of file LoadStoreVectorizer.cpp.

◆ StackAdjustedAlignment

const unsigned StackAdjustedAlignment = 4
static

Definition at line 96 of file LoadStoreVectorizer.cpp.

Referenced by getChainID().