LLVM  13.0.0git
Macros | Functions | Variables
BDCE.cpp File Reference
#include "llvm/Transforms/Scalar/BDCE.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/DemandedBits.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Local.h"
Include dependency graph for BDCE.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "bdce"
 

Functions

 STATISTIC (NumRemoved, "Number of instructions removed (unused)")
 
 STATISTIC (NumSimplified, "Number of instructions trivialized (dead bits)")
 
 STATISTIC (NumSExt2ZExt, "Number of sign extension instructions converted to zero extension")
 
static void clearAssumptionsOfUsers (Instruction *I, DemandedBits &DB)
 If an instruction is trivialized (dead), then the chain of users of that instruction may need to be cleared of assumptions that can no longer be guaranteed correct. More...
 
static bool bitTrackingDCE (Function &F, DemandedBits &DB)
 
 INITIALIZE_PASS_BEGIN (BDCELegacyPass, "bdce", "Bit-Tracking Dead Code Elimination", false, false) INITIALIZE_PASS_END(BDCELegacyPass
 

Variables

 bdce
 
Bit Tracking Dead Code Elimination
 
Bit Tracking Dead Code false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "bdce"

Definition at line 34 of file BDCE.cpp.

Function Documentation

◆ bitTrackingDCE()

static bool bitTrackingDCE ( Function F,
DemandedBits DB 
)
static

◆ clearAssumptionsOfUsers()

static void clearAssumptionsOfUsers ( Instruction I,
DemandedBits DB 
)
static

If an instruction is trivialized (dead), then the chain of users of that instruction may need to be cleared of assumptions that can no longer be guaranteed correct.

Definition at line 44 of file BDCE.cpp.

References assert(), llvm::Instruction::dropPoisonGeneratingFlags(), llvm::DemandedBits::getDemandedBits(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::APInt::isAllOnesValue(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::Value::users().

Referenced by bitTrackingDCE().

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( BDCELegacyPass  ,
"bdce"  ,
"Bit-Tracking Dead Code Elimination ,
false  ,
false   
)

◆ STATISTIC() [1/3]

STATISTIC ( NumRemoved  ,
"Number of instructions removed (unused)"   
)

◆ STATISTIC() [2/3]

STATISTIC ( NumSExt2ZExt  ,
"Number of sign extension instructions converted to zero extension"   
)

◆ STATISTIC() [3/3]

STATISTIC ( NumSimplified  ,
"Number of instructions trivialized (dead bits)"   
)

Variable Documentation

◆ bdce

bdce

Definition at line 202 of file BDCE.cpp.

◆ Elimination

Bit Tracking Dead Code Elimination

Definition at line 203 of file BDCE.cpp.

◆ false

Bit Tracking Dead Code false

Definition at line 203 of file BDCE.cpp.