LLVM
8.0.1
|
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Transforms/Scalar.h"
#include <cassert>
#include <cstdint>
#include <limits>
#include <list>
#include <vector>
Go to the source code of this file.
Functions | |
INITIALIZE_PASS_BEGIN (StraightLineStrengthReduce, "slsr", "Straight line strength reduction", false, false) INITIALIZE_PASS_END(StraightLineStrengthReduce | |
static bool | isGEPFoldable (GetElementPtrInst *GEP, const TargetTransformInfo *TTI) |
static bool | isAddFoldable (const SCEV *Base, ConstantInt *Index, Value *Stride, TargetTransformInfo *TTI) |
static bool | hasOnlyOneNonZeroIndex (GetElementPtrInst *GEP) |
static bool | matchesAdd (Value *A, Value *&B, ConstantInt *&C) |
static bool | matchesOr (Value *A, Value *&B, ConstantInt *&C) |
static void | unifyBitWidth (APInt &A, APInt &B) |
Variables | |
static const unsigned | UnknownAddressSpace |
slsr | |
Straight line strength | reduction |
Straight line strength | false |
|
static |
Definition at line 302 of file StraightLineStrengthReduce.cpp.
References llvm::MCID::Add, assert(), B, C, llvm::dyn_cast(), GEP, llvm::ConstantInt::get(), llvm::ConstantInt::getBitWidth(), llvm::User::getNumOperands(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Value::getType(), I, llvm::GetElementPtrInst::idx_begin(), llvm::GetElementPtrInst::idx_end(), llvm::ConstantInt::isZero(), Kind, llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Mul(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Value(), and llvm::PatternMatch::match().
INITIALIZE_PASS_BEGIN | ( | StraightLineStrengthReduce | , |
"slsr" | , | ||
"Straight line strength reduction" | , | ||
false | , | ||
false | |||
) |
|
static |
Definition at line 283 of file StraightLineStrengthReduce.cpp.
References llvm::MCID::Add, GEP, llvm::ConstantInt::getBitWidth(), llvm::ConstantInt::getSExtValue(), llvm::SCEV::getType(), isGEPFoldable(), llvm::TargetTransformInfo::isLegalAddressingMode(), and UnknownAddressSpace.
|
static |
Definition at line 273 of file StraightLineStrengthReduce.cpp.
References llvm::TargetTransformInfo::getGEPCost(), llvm::GetElementPtrInst::getPointerOperand(), llvm::GetElementPtrInst::getSourceElementType(), I, llvm::GetElementPtrInst::idx_begin(), llvm::GetElementPtrInst::idx_end(), llvm::SmallVectorTemplateBase< T >::push_back(), and llvm::TargetTransformInfo::TCC_Free.
Referenced by isAddFoldable().
|
static |
Definition at line 421 of file StraightLineStrengthReduce.cpp.
References llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_Value(), and llvm::PatternMatch::match().
Referenced by matchesOr().
|
static |
Definition at line 427 of file StraightLineStrengthReduce.cpp.
References assert(), E, GEP, llvm::gep_type_begin(), llvm::ConstantInt::get(), llvm::GetElementPtrInst::getAddressSpace(), llvm::ConstantInt::getBitWidth(), llvm::Value::getContext(), llvm::generic_gep_type_iterator< ItTy >::getIndexedType(), llvm::Type::getIntegerBitWidth(), llvm::DataLayout::getIntPtrType(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::DataLayout::getPointerSizeInBits(), llvm::ConstantInt::getSExtValue(), llvm::SCEV::getType(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::ConstantInt::getValue(), llvm::haveNoCommonBitsSet(), I, llvm::GetElementPtrInst::idx_begin(), llvm::GetElementPtrInst::idx_end(), llvm::generic_gep_type_iterator< ItTy >::isStruct(), llvm::Type::isVectorTy(), llvm::PatternMatch::m_ConstantInt(), llvm::PatternMatch::m_NSWMul(), llvm::PatternMatch::m_NSWShl(), llvm::PatternMatch::m_Or(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), matchesAdd(), and llvm::SmallVectorTemplateBase< T >::push_back().
Definition at line 564 of file StraightLineStrengthReduce.cpp.
References llvm::MCID::Add, assert(), llvm::IRBuilder< T, Inserter >::CreateAdd(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateGEP(), llvm::IRBuilder< T, Inserter >::CreateInBoundsGEP(), llvm::IRBuilder< T, Inserter >::CreateMul(), llvm::IRBuilder< T, Inserter >::CreateNeg(), llvm::IRBuilder< T, Inserter >::CreateSExtOrTrunc(), llvm::IRBuilder< T, Inserter >::CreateShl(), llvm::IRBuilder< T, Inserter >::CreateSub(), llvm::Exponent, F(), GEP, llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::APInt::getBitWidth(), llvm::Type::getInt8PtrTy(), llvm::IRBuilderBase::getInt8Ty(), llvm::DataLayout::getIntPtrType(), llvm::DataLayout::getTypeAllocSize(), llvm::APInt::isAllOnesValue(), llvm::APInt::isPowerOf2(), llvm_unreachable, llvm::APInt::logBase2(), llvm::PatternMatch::m_Neg(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), runOnFunction(), llvm::APInt::sdivrem(), llvm::APInt::sext(), and llvm::Value::takeName().
Straight line strength false |
Definition at line 253 of file StraightLineStrengthReduce.cpp.
Straight line strength reduction |
Definition at line 253 of file StraightLineStrengthReduce.cpp.
slsr |
Definition at line 253 of file StraightLineStrengthReduce.cpp.
Definition at line 93 of file StraightLineStrengthReduce.cpp.
Referenced by getAccessType(), and isAddFoldable().