LLVM  4.0.0
Macros | Functions | Variables
ConstantHoisting.cpp File Reference
#include "llvm/Transforms/Scalar/ConstantHoisting.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.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 (ConstantHoistingLegacyPass,"consthoist","Constant Hoisting", false, false) INITIALIZE_PASS_END(ConstantHoistingLegacyPass
 
static llvm::Optional< APIntcalculateOffsetDiff (APInt V1, APInt V2)
 
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

static llvm::Optional<APInt> calculateOffsetDiff ( APInt  V1,
APInt  V2 
)
static
INITIALIZE_PASS_BEGIN ( ConstantHoistingLegacyPass  ,
"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 incoming 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 451 of file ConstantHoisting.cpp.

References i, and llvm::User::setOperand().

Variable Documentation

consthoist

Definition at line 87 of file ConstantHoisting.cpp.

Constant false

Definition at line 87 of file ConstantHoisting.cpp.

Constant Hoisting

Definition at line 87 of file ConstantHoisting.cpp.