LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

LoopUnroll.cpp File Reference

#include "llvm/Transforms/Scalar.h"
#include "llvm/Constants.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/IntrinsicInst.h"
#include <cstdio>
#include <set>
#include <algorithm>

Include dependency graph for LoopUnroll.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "loop-unroll"

Functions

FunctionPassllvm::createLoopUnrollPass ()
static unsigned ApproximateLoopSize (const Loop *L)
static void RemapInstruction (Instruction *I, std::map< const Value *, Value * > &ValueMap)


Define Documentation

#define DEBUG_TYPE   "loop-unroll"
 

Definition at line 19 of file LoopUnroll.cpp.


Function Documentation

static unsigned ApproximateLoopSize const Loop L  )  [static]
 

ApproximateLoopSize - Approximate the size of the loop after it has been unrolled.

Definition at line 80 of file LoopUnroll.cpp.

References llvm::BasicBlock::begin(), E, llvm::BasicBlock::end(), llvm::Loop::getBlocks(), llvm::Loop::getHeader(), llvm::BasicBlock::getTerminator(), and I.

static void RemapInstruction Instruction I,
std::map< const Value *, Value * > &  ValueMap
[inline, static]
 

Definition at line 108 of file LoopUnroll.cpp.

References E, llvm::User::getNumOperands(), llvm::User::getOperand(), and llvm::User::setOperand().


Variable Documentation

Statistic NumUnrolled("loop-unroll","Number of loops completely unrolled") [static]
 

cl::opt<unsigned> UnrollThreshold("unroll-threshold", cl::init(100), cl::Hidden, cl::desc("The cut-off point for loop unrolling")) [static]
 

RegisterOpt<LoopUnroll> X("loop-unroll","Unroll loops") [static]