LLVM
8.0.1
|
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/AliasSetTracker.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.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/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/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/Type.h"
#include "llvm/IR/Use.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/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <iterator>
#include <map>
#include <utility>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "loop-reroll" |
Enumerations | |
enum | IterationLimits |
Functions | |
STATISTIC (NumRerolledLoops, "Number of rerolled loops") | |
static bool | hasUsesOutsideLoop (Instruction *I, Loop *L) |
static bool | isUnorderedLoadStore (Instruction *I) |
static bool | isSimpleArithmeticOp (User *IVU) |
Return true if IVU is a "simple" arithmetic operation. More... | |
static bool | isLoopIncrement (User *U, Instruction *IV) |
static bool | isIgnorableInst (const Instruction *I) |
Variables | |
static cl::opt< unsigned > | NumToleratedFailedMatches ("reroll-num-tolerated-failed-matches", cl::init(400), cl::Hidden, cl::desc("The maximum number of failures to tolerate" " during fuzzy matching. (default: 400)")) |
#define DEBUG_TYPE "loop-reroll" |
Definition at line 68 of file LoopRerollPass.cpp.
enum IterationLimits |
Definition at line 155 of file LoopRerollPass.cpp.
|
static |
Definition at line 501 of file LoopRerollPass.cpp.
References llvm::ARM_AM::add, llvm::MCID::Add, assert(), llvm::BasicBlock::begin(), C, llvm::LoopBase< BlockT, LoopT >::contains(), llvm::dbgs(), llvm::dyn_cast(), llvm::BasicBlock::getFirstInsertionPt(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::Value::getNumUses(), llvm::ConstantInt::getSExtValue(), llvm::SCEVConstant::getValue(), llvm::Value::hasOneUse(), I, llvm::ARM_PROC::IE, llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::insert(), llvm::Instruction::isBinaryOp(), llvm::Instruction::isSameOperationAs(), LLVM_DEBUG, llvm::User::op_begin(), llvm::User::op_end(), llvm::Value::use_empty(), llvm::Value::user_begin(), llvm::Value::user_empty(), Users, llvm::Value::users(), and llvm::Value::uses().
Referenced by isIgnorableInst().
|
static |
Definition at line 1107 of file LoopRerollPass.cpp.
References llvm::AliasSetTracker::add(), llvm::Intrinsic::annotation, assert(), llvm::Continue, llvm::dbgs(), llvm::DeleteDeadPHIs(), llvm::dyn_cast(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::SCEVExpander::expandCodeFor(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::SCEV::FlagAnyWrap, llvm::Module::getDataLayout(), llvm::BasicBlock::getFirstNonPHIOrDbg(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::IntrinsicInst::getIntrinsicID(), llvm::BasicBlock::getModule(), llvm::Value::getName(), llvm::LoopBase< BlockT, LoopT >::getNumBlocks(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::BasicBlock::getParent(), llvm::SCEVAddRecExpr::getStart(), llvm::BranchInst::getSuccessor(), llvm::BasicBlock::getTerminator(), llvm::SCEV::getType(), llvm::Value::getType(), hasUsesOutsideLoop(), I, llvm::CmpInst::ICMP_EQ, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::Instruction::isAssociative(), isAssociative(), llvm::Instruction::isCommutative(), llvm::isSafeToSpeculativelyExecute(), llvm::Instruction::isSameOperationAs(), isUnorderedLoadStore(), llvm::LCSSAID, LLVM_DEBUG, llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayWriteToMemory(), N, NumToleratedFailedMatches, llvm::Intrinsic::ptr_annotation, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::BasicBlock::rbegin(), llvm::BasicBlock::rend(), replace(), llvm::User::replaceUsesOfWith(), llvm::BranchInst::setCondition(), llvm::SimplifyInstructionsInBlock(), llvm::size(), llvm::BranchInst::swapSuccessors(), llvm::Value::user_begin(), users, Users, llvm::Value::users(), and llvm::Intrinsic::var_annotation.
|
static |
Definition at line 763 of file LoopRerollPass.cpp.
References llvm::abs(), llvm::MCID::Add, llvm::AArch64ISD::ADR, assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::dbgs(), llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T >::end(), GEP, llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::BinaryOperator::getOpcode(), llvm::APInt::getSExtValue(), llvm::SCEV::getType(), llvm::ConstantInt::getValue(), llvm::Value::hasNUsesOrMore(), I, llvm::tgtok::In, llvm::is_contained(), isSimpleArithmeticOp(), LLVM_DEBUG, N, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, ValueInfoT, detail::DenseSetPair< ValueT > >, ValueInfoT >::size(), and llvm::Value::users().
Return true if IVU is a "simple" arithmetic operation.
This is used for narrowing the search space for DAGRoots; only arithmetic and GEPs can be part of a DAGRoot.
Definition at line 743 of file LoopRerollPass.cpp.
References llvm::MCID::Add, and I.
Referenced by isLoopIncrement().
|
static |
Definition at line 730 of file LoopRerollPass.cpp.
Referenced by isIgnorableInst().
STATISTIC | ( | NumRerolledLoops | , |
"Number of rerolled loops" | |||
) |
|
static |
Referenced by isIgnorableInst().