LLVM 24.0.0git
ConstantHoisting.cpp File Reference

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 void findBestInsertionSet (DominatorTree &DT, BlockFrequencyInfo &BFI, BasicBlock *Entry, SetVector< BasicBlock * > &BBs)
 Given BBs as input, find another set of BBs which collectively dominates BBs and have the minimal sum of frequencies.
static bool updateOperand (Instruction *Inst, unsigned Idx, Instruction *Mat)
 Updates the operand at Idx in instruction Inst with the result of instruction Mat.

Variables

 consthoist
Constant Hoisting
Constant false

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "consthoist"

Definition at line 73 of file ConstantHoisting.cpp.

Function Documentation

◆ findBestInsertionSet()

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( ConstantHoistingLegacyPass ,
"consthoist" ,
"Constant Hoisting" ,
false ,
false  )

◆ STATISTIC() [1/2]

STATISTIC ( NumConstantsHoisted ,
"Number of constants hoisted"  )

◆ STATISTIC() [2/2]

STATISTIC ( NumConstantsRebased ,
"Number of constants rebased"  )

◆ updateOperand()

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 from 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 696 of file ConstantHoisting.cpp.

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

Variable Documentation

◆ consthoist

consthoist

Definition at line 116 of file ConstantHoisting.cpp.

◆ false

Constant false

Definition at line 117 of file ConstantHoisting.cpp.

◆ Hoisting

Constant Hoisting

Definition at line 117 of file ConstantHoisting.cpp.