LLVM  3.7.0
Macros | Functions | Variables
ConstantHoisting.cpp File Reference
#include "llvm/Transforms/Scalar.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <tuple>
Include dependency graph for ConstantHoisting.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "consthoist"
 

Functions

 STATISTIC (NumConstantsHoisted,"Number of constants hoisted")
 
 STATISTIC (NumConstantsRebased,"Number of constants rebased")
 
 INITIALIZE_PASS_BEGIN (ConstantHoisting,"consthoist","Constant Hoisting", false, false) INITIALIZE_PASS_END(ConstantHoisting
 
static bool updateOperand (Instruction *Inst, unsigned Idx, Instruction *Mat)
 Updates the operand at Idx in instruction Inst with the result of instruction Mat. More...
 

Variables

 consthoist
 
Constant Hoisting
 
Constant false
 

Macro Definition Documentation

#define DEBUG_TYPE   "consthoist"

Definition at line 51 of file ConstantHoisting.cpp.

Function Documentation

INITIALIZE_PASS_BEGIN ( ConstantHoisting  ,
"consthoist"  ,
"Constant Hoisting ,
false  ,
false   
)
STATISTIC ( NumConstantsHoisted  ,
"Number of constants hoisted"   
)
STATISTIC ( NumConstantsRebased  ,
"Number of constants rebased"   
)
static bool updateOperand ( Instruction Inst,
unsigned  Idx,
Instruction Mat 
)
static

Updates the operand at Idx in instruction Inst with the result of instruction Mat.

If the instruction is a PHI node then special handling for duplicate values form the same incomming basic block is required.

Returns
The update will always succeed, but the return value indicated if Mat was used for the update or not.

Definition at line 445 of file ConstantHoisting.cpp.

References llvm::TargetOpcode::PHI, and llvm::User::setOperand().

Variable Documentation

consthoist

Definition at line 181 of file ConstantHoisting.cpp.

Constant false

Definition at line 181 of file ConstantHoisting.cpp.

Constant Hoisting

Definition at line 181 of file ConstantHoisting.cpp.