|
LLVM
10.0.0
|
Insert hardware loop intrinsics into loops which are deemed profitable by the target, by querying TargetTransformInfo. More...
#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/AssumptionCache.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/Analysis/OptimizationRemarkEmitter.h"#include "llvm/Analysis/ScalarEvolution.h"#include "llvm/Analysis/ScalarEvolutionExpander.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/CodeGen/Passes.h"#include "llvm/CodeGen/TargetPassConfig.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Value.h"#include "llvm/InitializePasses.h"#include "llvm/Pass.h"#include "llvm/PassRegistry.h"#include "llvm/PassSupport.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Transforms/Scalar.h"#include "llvm/Transforms/Utils.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/LoopUtils.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "hardware-loops" |
| #define | HW_LOOPS_NAME "Hardware Loop Insertion" |
Functions | |
| STATISTIC (NumHWLoops, "Number of loops converted to hardware loops") | |
| static void | debugHWLoopFailure (const StringRef DebugMsg, Instruction *I) |
| static OptimizationRemarkAnalysis | createHWLoopAnalysis (StringRef RemarkName, Loop *L, Instruction *I) |
| static bool | CanGenerateTest (Loop *L, Value *Count) |
Variables | |
| static cl::opt< bool > | ForceHardwareLoops ("force-hardware-loops", cl::Hidden, cl::init(false), cl::desc("Force hardware loops intrinsics to be inserted")) |
| static cl::opt< bool > | ForceHardwareLoopPHI ("force-hardware-loop-phi", cl::Hidden, cl::init(false), cl::desc("Force hardware loop counter to be updated through a phi")) |
| static cl::opt< bool > | ForceNestedLoop ("force-nested-hardware-loop", cl::Hidden, cl::init(false), cl::desc("Force allowance of nested hardware loops")) |
| static cl::opt< unsigned > | LoopDecrement ("hardware-loop-decrement", cl::Hidden, cl::init(1), cl::desc("Set the loop decrement value")) |
| static cl::opt< unsigned > | CounterBitWidth ("hardware-loop-counter-bitwidth", cl::Hidden, cl::init(32), cl::desc("Set the loop counter bitwidth")) |
| static cl::opt< bool > | ForceGuardLoopEntry ("force-hardware-loop-guard", cl::Hidden, cl::init(false), cl::desc("Force generation of loop guard intrinsic")) |
Insert hardware loop intrinsics into loops which are deemed profitable by the target, by querying TargetTransformInfo.
A hardware loop comprises of two intrinsics: one, outside the loop, to set the loop iteration count and another, in the exit block, to decrement the counter. The decremented value can either be carried through the loop via a phi or handled in some opaque way by the target.
Definition in file HardwareLoops.cpp.
| #define DEBUG_TYPE "hardware-loops" |
Definition at line 47 of file HardwareLoops.cpp.
Referenced by CanGenerateTest(), and createHWLoopAnalysis().
| #define HW_LOOPS_NAME "Hardware Loop Insertion" |
Definition at line 49 of file HardwareLoops.cpp.
Referenced by CanGenerateTest().
Definition at line 341 of file HardwareLoops.cpp.
References assert(), llvm::LoopBase< BlockT, LoopT >::contains(), llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateICmpNE(), llvm::dbgs(), DEBUG_TYPE, llvm::SCEVExpander::expandCodeFor(), ForceGuardLoopEntry, llvm::ConstantInt::get(), llvm::Intrinsic::getDeclaration(), llvm::BasicBlock::getFirstNonPHI(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::Value::getName(), llvm::User::getOperand(), llvm::BasicBlock::getParent(), llvm::CmpInst::getPredicate(), llvm::BasicBlock::getSinglePredecessor(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), HW_LOOPS_NAME, llvm::CmpInst::ICMP_NE, INITIALIZE_PASS_BEGIN, INITIALIZE_PASS_DEPENDENCY, INITIALIZE_PASS_END(), llvm::isSafeToExpandAt(), LLVM_DEBUG, LoopDecrement, and llvm::RecursivelyDeleteTriviallyDeadInstructions().
|
static |
Definition at line 94 of file HardwareLoops.cpp.
References llvm::AnalysisUsage::addPreserved(), llvm::AnalysisUsage::addRequired(), assert(), llvm::LoopBase< BlockT, LoopT >::begin(), llvm::LoopBase< BlockT, LoopT >::blocks(), llvm::HardwareLoopInfo::canAnalyze(), CounterBitWidth, llvm::HardwareLoopInfo::CounterInReg, llvm::HardwareLoopInfo::CountType, llvm::dbgs(), DEBUG_TYPE, debugHWLoopFailure(), llvm::DeleteDeadPHIs(), E, llvm::OptimizationRemarkEmitter::emit(), llvm::LoopBase< BlockT, LoopT >::end(), llvm::HardwareLoopInfo::ExitBlock, llvm::HardwareLoopInfo::ExitBranch, llvm::HardwareLoopInfo::ExitCount, F(), ForceHardwareLoopPHI, ForceHardwareLoops, ForceNestedLoop, llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::Module::getDataLayout(), llvm::Instruction::getDebugLoc(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::Value::getName(), llvm::Instruction::getParent(), llvm::GlobalValue::getParent(), llvm::LoopBase< BlockT, LoopT >::getParentLoop(), llvm::PassRegistry::getPassRegistry(), llvm::Loop::getStartLoc(), I, Info, llvm::initializeHardwareLoopsPass(), llvm::InsertPreheaderForLoop(), llvm::HardwareLoopInfo::isHardwareLoopCandidate(), llvm::HardwareLoopInfo::IsNestingLegal, llvm::HardwareLoopInfo::L, llvm::LCSSAID, LLVM_DEBUG, LoopDecrement, llvm::HardwareLoopInfo::LoopDecrement, llvm::HardwareLoopInfo::PerformEntryTest, runOnFunction(), and llvm::User::setOperand().
|
static |
Definition at line 82 of file HardwareLoops.cpp.
References llvm::dbgs(), and I.
Referenced by createHWLoopAnalysis().
|
static |
Referenced by createHWLoopAnalysis().
|
static |
Referenced by CanGenerateTest().
|
static |
Referenced by createHWLoopAnalysis().
|
static |
Referenced by createHWLoopAnalysis().
|
static |
Referenced by createHWLoopAnalysis(), and llvm::HardwareLoopInfo::isHardwareLoopCandidate().
|
static |
Referenced by CanGenerateTest(), and createHWLoopAnalysis().
1.8.13