LLVM API Documentation

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 <iostream>

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)

Variables

Statistic NumUnrolled ("loop-unroll","Number of loops completely unrolled")
cl::opt< unsigned > UnrollThreshold ("unroll-threshold", cl::init(100), cl::Hidden, cl::desc("The cut-off point for loop unrolling"))
LoopInfoLI
RegisterOpt< LoopUnroll > X ("loop-unroll","Unroll loops")


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 BB, 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(), Op, and llvm::User::setOperand().


Variable Documentation

LoopInfo* LI

Definition at line 46 of file LoopUnroll.cpp.

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]