LLVM
8.0.1
|
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugLoc.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/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PatternMatch.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/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iterator>
#include <map>
#include <set>
#include <utility>
#include <vector>
Go to the source code of this file.
Namespaces | |
llvm | |
This class represents lattice values for constants. | |
Macros | |
#define | DEBUG_TYPE "hexagon-lir" |
Functions | |
void | llvm::initializeHexagonLoopIdiomRecognizePass (PassRegistry &) |
Pass * | llvm::createHexagonLoopIdiomPass () |
INITIALIZE_PASS_BEGIN (HexagonLoopIdiomRecognize, "hexagon-loop-idiom", "Recognize Hexagon-specific loop idioms", false, false) INITIALIZE_PASS_END(HexagonLoopIdiomRecognize | |
static void | replaceAllUsesOfWithIn (Value *I, Value *J, BasicBlock *BB) |
static bool | hasZeroSignBit (const Value *V) |
static bool | mayLoopAccessLocation (Value *Ptr, ModRefInfo Access, Loop *L, const SCEV *BECount, unsigned StoreSize, AliasAnalysis &AA, SmallPtrSetImpl< Instruction *> &Ignored) |
mayLoopAccessLocation - Return true if the specified loop might access the specified pointer location, which is a loop-strided access. More... | |
Variables | |
static cl::opt< bool > | DisableMemcpyIdiom ("disable-memcpy-idiom", cl::Hidden, cl::init(false), cl::desc("Disable generation of memcpy in loop idiom recognition")) |
static cl::opt< bool > | DisableMemmoveIdiom ("disable-memmove-idiom", cl::Hidden, cl::init(false), cl::desc("Disable generation of memmove in loop idiom recognition")) |
static cl::opt< unsigned > | RuntimeMemSizeThreshold ("runtime-mem-idiom-threshold", cl::Hidden, cl::init(0), cl::desc("Threshold (in bytes) for the runtime " "check guarding the memmove.")) |
static cl::opt< unsigned > | CompileTimeMemSizeThreshold ("compile-time-mem-idiom-threshold", cl::Hidden, cl::init(64), cl::desc("Threshold (in bytes) to perform the transformation, if the " "runtime loop count (mem transfer size) is known at compile-time.")) |
static cl::opt< bool > | OnlyNonNestedMemmove ("only-nonnested-memmove-idiom", cl::Hidden, cl::init(true), cl::desc("Only enable generating memmove in non-nested loops")) |
cl::opt< bool > | HexagonVolatileMemcpy ("disable-hexagon-volatile-memcpy", cl::Hidden, cl::init(false), cl::desc("Enable Hexagon-specific memcpy for volatile destination.")) |
static cl::opt< unsigned > | SimplifyLimit ("hlir-simplify-limit", cl::init(10000), cl::Hidden, cl::desc("Maximum number of simplification steps in HLIR")) |
static const char * | HexagonVolatileMemcpyName = "hexagon_memcpy_forward_vp4cp4n2" |
hexagon loop | idiom |
hexagon loop Recognize Hexagon specific loop | idioms |
hexagon loop Recognize Hexagon specific loop | false |
#define DEBUG_TYPE "hexagon-lir" |
Definition at line 10 of file HexagonLoopIdiomRecognition.cpp.
Definition at line 1562 of file HexagonLoopIdiomRecognition.cpp.
References llvm::abs(), assert(), B, C, Context, llvm::IRBuilder< T, Inserter >::CreateAnd(), llvm::IRBuilder< T, Inserter >::CreateBinOp(), llvm::IRBuilder< T, Inserter >::CreateIntCast(), llvm::IRBuilder< T, Inserter >::CreateLShr(), llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::IRBuilder< T, Inserter >::CreateXor(), llvm::IRBuilder< T, Inserter >::CreateZExt(), llvm::dbgs(), llvm::dyn_cast(), llvm::SelectInst::getCondition(), llvm::SelectInst::getFalseValue(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Instruction::getOpcode(), getOpcode(), llvm::BinaryOperator::getOpcode(), llvm::SCEVNAryExpr::getOperand(), llvm::User::getOperand(), llvm::LoadInst::getPointerOperand(), llvm::StoreInst::getPointerOperand(), llvm::IntegerType::getSignBit(), llvm::BasicBlock::getTerminator(), llvm::SelectInst::getTrueValue(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::StoreInst::getValueOperand(), llvm::ConstantInt::getZExtValue(), HexagonVolatileMemcpy, I, llvm::tgtok::In, llvm::LoadInst::isSimple(), llvm::StoreInst::isSimple(), llvm::StoreInst::isVolatile(), LLVM_DEBUG, P, llvm::RecursivelyDeleteTriviallyDeadInstructions(), llvm::Value::replaceAllUsesWith(), llvm::PPCISD::SC, SI, std::swap(), T, llvm::Value::users(), X, Y, and llvm::Z.
INITIALIZE_PASS_BEGIN | ( | HexagonLoopIdiomRecognize | , |
"hexagon-loop-idiom" | , | ||
"Recognize Hexagon-specific loop idioms" | , | ||
false | , | ||
false | |||
) |
|
static |
mayLoopAccessLocation - Return true if the specified loop might access the specified pointer location, which is a loop-strided access.
The 'Access' argument specifies what the verboten forms of access are (read or write).
Definition at line 1966 of file HexagonLoopIdiomRecognition.cpp.
References llvm::LoopBase< BlockT, LoopT >::addBasicBlockToLoop(), llvm::all_of(), llvm::Attribute::AlwaysInline, assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::LoopBase< BlockT, LoopT >::blocks(), llvm::SCEVExpander::clear(), llvm::SmallVectorImpl< T >::clear(), CompileTimeMemSizeThreshold, llvm::SmallSet< T, N, C >::count(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::BasicBlock::Create(), llvm::IRBuilder< T, Inserter >::CreateAnd(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateBr(), llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateCondBr(), llvm::IRBuilder< T, Inserter >::CreateICmpSLE(), llvm::IRBuilder< T, Inserter >::CreateICmpULT(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilder< T, Inserter >::CreateOr(), llvm::IRBuilder< T, Inserter >::CreatePtrToInt(), llvm::IRBuilder< T, Inserter >::CreateSub(), llvm::dbgs(), DisableMemcpyIdiom, DisableMemmoveIdiom, llvm::dyn_cast(), E, llvm::SmallVectorTemplateCommon< T >::end(), llvm::Instruction::eraseFromParent(), llvm::SCEVExpander::expandCodeFor(), llvm::GlobalValue::ExternalLinkage, llvm::SCEV::FlagNUW, llvm::ConstantInt::get(), llvm::LoadInst::getAlignment(), llvm::StoreInst::getAlignment(), llvm::PHINode::getBasicBlockIndex(), llvm::LoopBase< BlockT, LoopT >::getBlocks(), llvm::Value::getContext(), llvm::Module::getDataLayout(), llvm::Instruction::getDebugLoc(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::Type::getInt32PtrTy(), llvm::Type::getInt32Ty(), llvm::IRBuilderBase::getInt8PtrTy(), llvm::IRBuilderBase::getIntPtrTy(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::AAResults::getModRefInfo(), llvm::BasicBlock::getModule(), llvm::Value::getName(), llvm::Module::getOrInsertFunction(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::LoopBase< BlockT, LoopT >::getParentLoop(), llvm::LoadInst::getPointerAddressSpace(), llvm::StoreInst::getPointerAddressSpace(), llvm::LoadInst::getPointerOperand(), llvm::StoreInst::getPointerOperand(), llvm::Module::getTargetTriple(), llvm::BasicBlock::getTerminator(), llvm::SCEV::getType(), llvm::Value::getType(), llvm::LoopBase< BlockT, LoopT >::getUniqueExitBlocks(), llvm::StoreInst::getValueOperand(), llvm::Type::getVoidTy(), llvm::Function::hasFnAttribute(), llvm::Triple::hexagon, HexagonVolatileMemcpy, HexagonVolatileMemcpyName, I, llvm::tgtok::In, llvm::SmallSet< T, N, C >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), Int32Ty, llvm::intersectModRef(), llvm::isModOrRefSet(), llvm::StoreInst::isSimple(), llvm::StoreInst::isVolatile(), LLVM_DEBUG, llvm::Mod, llvm::ModRef, Name, OnlyNonNestedMemmove, llvm::User::op_begin(), llvm::User::op_end(), llvm::LocationSize::precise(), llvm::pred_begin(), llvm::pred_end(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), RuntimeMemSizeThreshold, llvm::Instruction::setDebugLoc(), llvm::DomTreeNodeBase< NodeT >::setIDom(), llvm::PHINode::setIncomingBlock(), llvm::IRBuilderBase::SetInsertPoint(), llvm::GlobalValue::setLinkage(), llvm::Value::setName(), llvm::SimplifyInstruction(), llvm::SmallVectorBase::size(), Threshold, llvm::LocationSize::unknown(), and llvm::Value::users().
|
static |
Definition at line 656 of file HexagonLoopIdiomRecognition.cpp.
References llvm::MCID::Add, assert(), B, llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::IntegerType::getBitWidth(), llvm::SelectInst::getCondition(), llvm::SelectInst::getFalseValue(), llvm::BasicBlock::getFirstNonPHI(), llvm::User::getNumOperands(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::BasicBlock::getParent(), llvm::BasicBlock::getSinglePredecessor(), llvm::BasicBlock::getTerminator(), llvm::SelectInst::getTrueValue(), llvm::Value::getType(), llvm::Use::getUser(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Value::hasOneUse(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::tgtok::In, llvm::Type::isIntegerTy(), llvm::Instruction::isTerminator(), llvm_unreachable, llvm::PatternMatch::m_And(), llvm::PatternMatch::m_ICmp(), llvm::PatternMatch::m_LShr(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_Shl(), llvm::PatternMatch::m_Specific(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Xor(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::m_ZExt(), llvm::BitmaskEnumDetail::Mask(), llvm::PatternMatch::match(), llvm::Value::mutateType(), N, P, llvm::BasicBlock::phis(), llvm::MCID::Select, llvm::User::setOperand(), llvm::transform(), llvm::Value::user_begin(), llvm::Value::user_end(), X, Y, and llvm::Z.
|
static |
Referenced by mayLoopAccessLocation().
|
static |
Referenced by mayLoopAccessLocation().
|
static |
Referenced by mayLoopAccessLocation().
hexagon loop Recognize Hexagon specific loop false |
Definition at line 266 of file HexagonLoopIdiomRecognition.cpp.
cl::opt<bool> HexagonVolatileMemcpy("disable-hexagon-volatile-memcpy", cl::Hidden, cl::init(false), cl::desc("Enable Hexagon-specific memcpy for volatile destination.")) |
Referenced by hasZeroSignBit(), and mayLoopAccessLocation().
Definition at line 105 of file HexagonLoopIdiomRecognition.cpp.
Referenced by mayLoopAccessLocation().
hexagon loop idiom |
Definition at line 266 of file HexagonLoopIdiomRecognition.cpp.
hexagon loop Recognize Hexagon specific loop idioms |
Definition at line 266 of file HexagonLoopIdiomRecognition.cpp.
|
static |
Referenced by mayLoopAccessLocation().
|
static |
Referenced by mayLoopAccessLocation().
|
static |