LLVM
8.0.1
|
#include "llvm/Transforms/Scalar/LoopUnrollAndJamPass.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/CodeMetrics.h"
#include "llvm/Analysis/DependenceAnalysis.h"
#include "llvm/Analysis/LoopAnalysisManager.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Pass.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/LoopPassManager.h"
#include "llvm/Transforms/Utils.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/UnrollLoop.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <string>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "loop-unroll-and-jam" |
Variables | |
static cl::opt< bool > | AllowUnrollAndJam ("allow-unroll-and-jam", cl::Hidden, cl::desc("Allows loops to be unroll-and-jammed.")) |
static cl::opt< unsigned > | UnrollAndJamCount ("unroll-and-jam-count", cl::Hidden, cl::desc("Use this unroll count for all loops including those with " "unroll_and_jam_count pragma values, for testing purposes")) |
static cl::opt< unsigned > | UnrollAndJamThreshold ("unroll-and-jam-threshold", cl::init(60), cl::Hidden, cl::desc("Threshold to use for inner loop when doing unroll and jam.")) |
static cl::opt< unsigned > | PragmaUnrollAndJamThreshold ("pragma-unroll-and-jam-threshold", cl::init(1024), cl::Hidden, cl::desc("Unrolled size limit for loops with an unroll_and_jam(full) or " "unroll_count pragma.")) |
loop unroll and | jam |
loop unroll and Unroll and Jam | loops |
loop unroll and Unroll and Jam | false |
static const char *const | LLVMLoopUnrollAndJamFollowupAll |
static const char *const | LLVMLoopUnrollAndJamFollowupInner |
static const char *const | LLVMLoopUnrollAndJamFollowupOuter |
static const char *const | LLVMLoopUnrollAndJamFollowupRemainderInner |
static const char *const | LLVMLoopUnrollAndJamFollowupRemainderOuter |
#define DEBUG_TYPE "loop-unroll-and-jam" |
Definition at line 57 of file LoopUnrollAndJamPass.cpp.
|
static |
Definition at line 154 of file LoopUnrollAndJamPass.cpp.
References llvm::TargetTransformInfo::UnrollingPreferences::AllowRemainder, llvm::computeUnrollCount(), llvm::TargetTransformInfo::UnrollingPreferences::Count, llvm::dbgs(), llvm::TargetTransformInfo::UnrollingPreferences::Force, llvm::LoopBase< BlockT, LoopT >::getBlocks(), llvm::ScalarEvolution::getSCEVAtScope(), getUnrollAndJammedLoopSize(), HasUnrollAndJamEnablePragma(), I, llvm::ScalarEvolution::isLoopInvariant(), LLVM_DEBUG, PragmaUnrollAndJamThreshold, llvm::TargetTransformInfo::UnrollingPreferences::Runtime, llvm::TargetTransformInfo::UnrollingPreferences::Threshold, UnrollAndJamCount, UnrollAndJamCountPragmaValue(), and llvm::TargetTransformInfo::UnrollingPreferences::UnrollAndJamInnerLoopThreshold.
Referenced by tryToUnrollAndJamLoop().
|
static |
Definition at line 146 of file LoopUnrollAndJamPass.cpp.
References assert(), llvm::TargetTransformInfo::UnrollingPreferences::BEInsns, and llvm::TargetTransformInfo::UnrollingPreferences::Count.
Referenced by computeUnrollAndJamCount().
Definition at line 94 of file LoopUnrollAndJamPass.cpp.
References llvm::Loop::getLoopID(), and llvm::GetUnrollMetadata().
Referenced by HasUnrollAndJamEnablePragma(), and UnrollAndJamCountPragmaValue().
Definition at line 102 of file LoopUnrollAndJamPass.cpp.
References assert(), llvm::dyn_cast(), llvm::Loop::getLoopID(), llvm::MDNode::getOperand(), llvm::MDString::getString(), and llvm::StringRef::startswith().
Referenced by tryToUnrollAndJamLoop().
Definition at line 125 of file LoopUnrollAndJamPass.cpp.
References GetUnrollMetadataForLoop().
Referenced by computeUnrollAndJamCount().
INITIALIZE_PASS_BEGIN | ( | LoopUnrollAndJam | , |
"loop-unroll-and-jam" | , | ||
"Unroll and Jam loops" | , | ||
false | , | ||
false | |||
) |
Referenced by tryToUnrollAndJamLoop().
|
static |
Definition at line 278 of file LoopUnrollAndJamPass.cpp.
References llvm::AnalysisUsage::addRequired(), AllowUnrollAndJam, llvm::ApproximateLoopSize(), llvm::TargetTransformInfo::UnrollingPreferences::BEInsns, llvm::CodeMetrics::collectEphemeralValues(), computeUnrollAndJamCount(), llvm::MCID::Convergent, llvm::TargetTransformInfo::UnrollingPreferences::Count, llvm::dbgs(), F(), llvm::FullyUnrolled, llvm::gatherUnrollingPreferences(), llvm::LoopBase< BlockT, LoopT >::getExitingBlock(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::getLoopAnalysisUsage(), llvm::Loop::getLoopID(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::Value::getName(), llvm::BasicBlock::getParent(), llvm::PassRegistry::getPassRegistry(), llvm::ScalarEvolution::getSmallConstantTripCount(), llvm::ScalarEvolution::getSmallConstantTripMultiple(), llvm::LoopBase< BlockT, LoopT >::getSubLoops(), llvm::Optional< T >::getValue(), HasAnyUnrollPragma(), llvm::hasUnrollAndJamTransformation(), llvm::Optional< T >::hasValue(), if(), INITIALIZE_PASS_BEGIN(), INITIALIZE_PASS_DEPENDENCY, llvm::initializeLoopUnrollAndJamPass(), llvm::Loop::isLoopSimplifyForm(), llvm::isSafeToUnrollAndJam(), LLVM_DEBUG, LLVMLoopUnrollAndJamFollowupAll, llvm::makeFollowupLoopID(), llvm::LPPassManager::markLoopAsDeleted(), llvm::None, llvm::PartiallyUnrolled, llvm::Loop::setLoopAlreadyUnrolled(), llvm::Loop::setLoopID(), llvm::TM_Disable, llvm::Unmodified, llvm::TargetTransformInfo::UnrollingPreferences::UnrollAndJam, llvm::TargetTransformInfo::UnrollingPreferences::UnrollAndJamInnerLoopThreshold, llvm::UnrollAndJamLoop(), UnrollAndJamThreshold, and llvm::TargetTransformInfo::UnrollingPreferences::UnrollRemainder.
Referenced by llvm::LoopUnrollAndJamPass::run().
Definition at line 131 of file LoopUnrollAndJamPass.cpp.
References assert(), llvm::MDNode::getNumOperands(), llvm::MDNode::getOperand(), and GetUnrollMetadataForLoop().
Referenced by computeUnrollAndJamCount().
|
static |
Referenced by tryToUnrollAndJamLoop().
loop unroll and Unroll and Jam false |
Definition at line 487 of file LoopUnrollAndJamPass.cpp.
loop unroll and jam |
Definition at line 487 of file LoopUnrollAndJamPass.cpp.
Metadata attribute names
Definition at line 61 of file LoopUnrollAndJamPass.cpp.
Referenced by tryToUnrollAndJamLoop().
Definition at line 63 of file LoopUnrollAndJamPass.cpp.
Definition at line 65 of file LoopUnrollAndJamPass.cpp.
Definition at line 67 of file LoopUnrollAndJamPass.cpp.
Definition at line 69 of file LoopUnrollAndJamPass.cpp.
loop unroll and Unroll and Jam loops |
Definition at line 487 of file LoopUnrollAndJamPass.cpp.
|
static |
Referenced by computeUnrollAndJamCount().
|
static |
Referenced by computeUnrollAndJamCount().