LLVM  4.0.0
Macros | Functions | Variables
LoopRotation.cpp File Reference
#include "llvm/Transforms/Scalar/LoopRotation.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/BasicAliasAnalysis.h"
#include "llvm/Analysis/CodeMetrics.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/InstructionSimplify.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.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/Scalar/LoopPassManager.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/SSAUpdater.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
Include dependency graph for LoopRotation.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loop-rotate"
 

Functions

 STATISTIC (NumRotated,"Number of loops rotated")
 
static void RewriteUsesOfClonedInstructions (BasicBlock *OrigHeader, BasicBlock *OrigPreheader, ValueToValueMapTy &ValueMap)
 RewriteUsesOfClonedInstructions - We just cloned the instructions from the old header into the preheader. More...
 
static bool shouldSpeculateInstrs (BasicBlock::iterator Begin, BasicBlock::iterator End, Loop *L)
 Determine whether the instructions in this range may be safely and cheaply speculated. More...
 
 INITIALIZE_PASS_BEGIN (LoopRotateLegacyPass,"loop-rotate","Rotate Loops", false, false) INITIALIZE_PASS_END(LoopRotateLegacyPass
 

Variables

static cl::opt< unsignedDefaultRotationThreshold ("rotation-max-header-size", cl::init(16), cl::Hidden, cl::desc("The default maximum header size for automatic loop rotation"))
 
loop rotate
 
loop Rotate Loops
 
loop Rotate false
 

Macro Definition Documentation

#define DEBUG_TYPE   "loop-rotate"

Definition at line 44 of file LoopRotation.cpp.

Function Documentation

INITIALIZE_PASS_BEGIN ( LoopRotateLegacyPass  ,
"loop-rotate ,
"Rotate Loops ,
false  ,
false   
)
static void RewriteUsesOfClonedInstructions ( BasicBlock OrigHeader,
BasicBlock OrigPreheader,
ValueToValueMapTy ValueMap 
)
static
static bool shouldSpeculateInstrs ( BasicBlock::iterator  Begin,
BasicBlock::iterator  End,
Loop L 
)
static

Determine whether the instructions in this range may be safely and cheaply speculated.

This is not an important enough situation to develop complex heuristics. We handle a single arithmetic instruction along with any type conversions.

Definition at line 485 of file LoopRotation.cpp.

References llvm::MCID::Add, llvm::APIntOps::And(), llvm::LoopBase< N, M >::contains(), llvm::WebAssembly::End, llvm::LoopBase< N, M >::getExitingBlock(), I, llvm::isSafeToSpeculativelyExecute(), LLVM_FALLTHROUGH, llvm::APIntOps::Or(), llvm::Value::users(), and llvm::APIntOps::Xor().

STATISTIC ( NumRotated  ,
"Number of loops rotated"   
)

Variable Documentation

cl::opt<unsigned> DefaultRotationThreshold("rotation-max-header-size", cl::init(16), cl::Hidden, cl::desc("The default maximum header size for automatic loop rotation"))
static
loop Rotate false

Definition at line 686 of file LoopRotation.cpp.

loop Rotate Loops

Definition at line 686 of file LoopRotation.cpp.

loop rotate