LLVM API Documentation
#include "llvm/Transforms/Scalar.h"
#include "llvm/Analysis/AssumptionTracker.h"
#include "llvm/Analysis/CodeMetrics.h"
#include "llvm/Analysis/FunctionTargetTransformInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Metadata.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/UnrollLoop.h"
#include <climits>
Go to the source code of this file.
Defines | |
#define | DEBUG_TYPE "loop-unroll" |
Functions | |
static unsigned | ApproximateLoopSize (const Loop *L, unsigned &NumCalls, bool &NotDuplicatable, const TargetTransformInfo &TTI, AssumptionTracker *AT) |
ApproximateLoopSize - Approximate the size of the loop. | |
static const MDNode * | GetUnrollMetadata (const Loop *L, StringRef Name) |
static bool | HasUnrollFullPragma (const Loop *L) |
static bool | HasUnrollDisablePragma (const Loop *L) |
static unsigned | UnrollCountPragmaValue (const Loop *L) |
static void | SetLoopAlreadyUnrolled (Loop *L) |
Variables | |
static cl::opt< unsigned > | UnrollThreshold ("unroll-threshold", cl::init(150), cl::Hidden, cl::desc("The cut-off point for automatic loop unrolling")) |
static cl::opt< unsigned > | UnrollCount ("unroll-count", cl::init(0), cl::Hidden, cl::desc("Use this unroll count for all loops including those with ""unroll_count pragma values, for testing purposes")) |
static cl::opt< bool > | UnrollAllowPartial ("unroll-allow-partial", cl::init(false), cl::Hidden, cl::desc("Allows loops to be partially unrolled until ""-unroll-threshold loop size is reached.")) |
static cl::opt< bool > | UnrollRuntime ("unroll-runtime", cl::ZeroOrMore, cl::init(false), cl::Hidden, cl::desc("Unroll loops with run-time trip counts")) |
static cl::opt< unsigned > | PragmaUnrollThreshold ("pragma-unroll-threshold", cl::init(16 *1024), cl::Hidden, cl::desc("Unrolled size limit for loops with an unroll(full) or ""unroll_count pragma.")) |
#define DEBUG_TYPE "loop-unroll" |
Definition at line 35 of file LoopUnrollPass.cpp.
static unsigned ApproximateLoopSize | ( | const Loop * | L, |
unsigned & | NumCalls, | ||
bool & | NotDuplicatable, | ||
const TargetTransformInfo & | TTI, | ||
AssumptionTracker * | AT | ||
) | [static] |
ApproximateLoopSize - Approximate the size of the loop.
Definition at line 207 of file LoopUnrollPass.cpp.
References llvm::CodeMetrics::analyzeBasicBlock(), llvm::LoopBase< BlockT, LoopT >::block_begin(), llvm::LoopBase< BlockT, LoopT >::block_end(), llvm::CodeMetrics::collectEphemeralValues(), I, Metrics, llvm::CodeMetrics::notDuplicatable, llvm::CodeMetrics::NumInlineCandidates, and llvm::CodeMetrics::NumInsts.
Definition at line 234 of file LoopUnrollPass.cpp.
References llvm::dyn_cast(), llvm::StringRef::equals(), llvm::Loop::getLoopID(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), and llvm::MDString::getString().
Referenced by HasUnrollDisablePragma(), HasUnrollFullPragma(), and UnrollCountPragmaValue().
static bool HasUnrollDisablePragma | ( | const Loop * | L | ) | [static] |
Definition at line 264 of file LoopUnrollPass.cpp.
References GetUnrollMetadata().
static bool HasUnrollFullPragma | ( | const Loop * | L | ) | [static] |
Definition at line 259 of file LoopUnrollPass.cpp.
References GetUnrollMetadata().
static void SetLoopAlreadyUnrolled | ( | Loop * | L | ) | [static] |
Definition at line 286 of file LoopUnrollPass.cpp.
References llvm::dyn_cast(), llvm::MDString::get(), llvm::MDNode::get(), llvm::BasicBlock::getContext(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::Loop::getLoopID(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), llvm::MDString::getString(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MDNode::replaceOperandWith(), llvm::Loop::setLoopID(), and llvm::StringRef::startswith().
static unsigned UnrollCountPragmaValue | ( | const Loop * | L | ) | [static] |
Definition at line 270 of file LoopUnrollPass.cpp.
References llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), and GetUnrollMetadata().
cl::opt<unsigned> PragmaUnrollThreshold("pragma-unroll-threshold", cl::init(16 *1024), cl::Hidden, cl::desc("Unrolled size limit for loops with an unroll(full) or ""unroll_count pragma.")) [static] |
cl::opt<bool> UnrollAllowPartial("unroll-allow-partial", cl::init(false), cl::Hidden, cl::desc("Allows loops to be partially unrolled until ""-unroll-threshold loop size is reached.")) [static] |
cl::opt<unsigned> UnrollCount("unroll-count", cl::init(0), cl::Hidden, cl::desc("Use this unroll count for all loops including those with ""unroll_count pragma values, for testing purposes")) [static] |
cl::opt<bool> UnrollRuntime("unroll-runtime", cl::ZeroOrMore, cl::init(false), cl::Hidden, cl::desc("Unroll loops with run-time trip counts")) [static] |
cl::opt<unsigned> UnrollThreshold("unroll-threshold", cl::init(150), cl::Hidden, cl::desc("The cut-off point for automatic loop unrolling")) [static] |