LLVM API Documentation

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

LoopSimplify.cpp File Reference

#include "llvm/Transforms/Scalar.h"
#include "llvm/Constant.h"
#include "llvm/Instructions.h"
#include "llvm/Function.h"
#include "llvm/Type.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Support/CFG.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/DepthFirstIterator.h"

Include dependency graph for LoopSimplify.cpp:

Go to the source code of this file.

Functions

FunctionPassllvm::createLoopSimplifyPass ()
static void AddBlockAndPredsToSet (BasicBlock *BB, BasicBlock *StopBlock, std::set< BasicBlock * > &Blocks)
static PHINodeFindPHIToPartitionLoops (Loop *L, DominatorSet &DS)


Function Documentation

static void AddBlockAndPredsToSet BasicBlock BB,
BasicBlock StopBlock,
std::set< BasicBlock * > &  Blocks
[static]
 

AddBlockAndPredsToSet - Add the specified block, and all of its predecessors, to the specified set, if it's not already in there. Stop predecessor traversal when we reach StopBlock.

Definition at line 421 of file LoopSimplify.cpp.

References E, llvm::pred_begin(), and llvm::pred_end().

static PHINode* FindPHIToPartitionLoops Loop L,
DominatorSet DS
[static]
 

FindPHIToPartitionLoops - The first part of loop-nestification is to find a PHI node that tells us how to partition the loops.

Definition at line 432 of file LoopSimplify.cpp.

References llvm::BasicBlock::begin(), llvm::Loop::contains(), llvm::DominatorSetBase::dominates(), llvm::Loop::getHeader(), llvm::PHINode::getIncomingBlock(), llvm::PHINode::getIncomingValue(), llvm::BasicBlock::getInstList(), llvm::PHINode::getNumIncomingValues(), llvm::Instruction::getParent(), llvm::hasConstantValue(), and llvm::Value::replaceAllUsesWith().


Variable Documentation

Statistic NumInserted("loopsimplify","Number of pre-header or exit blocks inserted") [static]
 

Statistic NumNested("loopsimplify","Number of nested loops split out") [static]
 

RegisterOpt<LoopSimplify> X("loopsimplify","Canonicalize natural loops", true) [static]