LLVM API Documentation

JumpThreading.cpp File Reference

#include "llvm/Transforms/Scalar.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/LLVMContext.h"
#include "llvm/Pass.h"
#include "llvm/Analysis/ConstantFolding.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Target/TargetData.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ValueHandle.h"
#include "llvm/Support/raw_ostream.h"

Include dependency graph for JumpThreading.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "jump-threading"

Functions

 STATISTIC (NumThreads,"Number of jumps threaded")
 STATISTIC (NumFolds,"Number of terminators folded")
FunctionPass * llvm::createJumpThreadingPass ()
static unsigned getJumpThreadDuplicationCost (const BasicBlock *BB)
static Constant * GetResultOfComparison (CmpInst::Predicate pred, Value *LHS, Value *RHS, LLVMContext &Context)

Variables

static cl::opt< unsigned > Threshold ("jump-threading-threshold", cl::desc("Max block size to duplicate for jump threading"), cl::init(6), cl::Hidden)
static RegisterPass
< JumpThreading > 
X ("jump-threading","Jump Threading")


Define Documentation

#define DEBUG_TYPE   "jump-threading"

Definition at line 14 of file JumpThreading.cpp.


Function Documentation

static unsigned getJumpThreadDuplicationCost ( const BasicBlock *  BB  )  [static]

getJumpThreadDuplicationCost - Return the cost of duplicating this block to thread across it.

Ignore PHI nodes, these will be flattened when duplication happens.

Definition at line 186 of file JumpThreading.cpp.

References llvm::BasicBlock::getFirstNonPHI().

static Constant* GetResultOfComparison ( CmpInst::Predicate  pred,
Value *  LHS,
Value *  RHS,
LLVMContext &  Context 
) [static]

GetResultOfComparison - Given an icmp/fcmp predicate and the left and right hand sides of the compare instruction, try to determine the result. If the result can not be determined, a null pointer is returned.

Definition at line 799 of file JumpThreading.cpp.

References llvm::Value::getType(), and llvm::ISD::isTrueWhenEqual().

STATISTIC ( NumFolds  ,
"Number of terminators folded"   
)

STATISTIC ( NumThreads  ,
"Number of jumps threaded"   
)


Variable Documentation

char ID [static]

Definition at line 68 of file JumpThreading.cpp.

Definition at line 65 of file JumpThreading.cpp.

Definition at line 61 of file JumpThreading.cpp.

cl::opt<unsigned> Threshold("jump-threading-threshold", cl::desc("Max block size to duplicate for jump threading"), cl::init(6), cl::Hidden) [static]

RegisterPass<JumpThreading> X("jump-threading","Jump Threading") [static]