LLVM  8.0.1
Macros | Functions | Variables
ADCE.cpp File Reference
#include "llvm/Transforms/Scalar/ADCE.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/IteratedDominanceFrontier.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/DomTreeUpdater.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Use.h"
#include "llvm/IR/Value.h"
#include "llvm/Pass.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include <cassert>
#include <cstddef>
#include <utility>
Include dependency graph for ADCE.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "adce"
 

Functions

 STATISTIC (NumRemoved, "Number of instructions removed")
 
 STATISTIC (NumBranchesRemoved, "Number of branch instructions removed")
 
static bool isUnconditionalBranch (Instruction *Term)
 
 INITIALIZE_PASS_BEGIN (ADCELegacyPass, "adce", "Aggressive Dead Code Elimination", false, false) INITIALIZE_PASS_END(ADCELegacyPass
 

Variables

static cl::opt< boolRemoveControlFlowFlag ("adce-remove-control-flow", cl::init(true), cl::Hidden)
 
static cl::opt< boolRemoveLoops ("adce-remove-loops", cl::init(false), cl::Hidden)
 
 adce
 
Aggressive Dead Code Elimination
 
Aggressive Dead Code false
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "adce"

Definition at line 58 of file ADCE.cpp.

Function Documentation

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( ADCELegacyPass  ,
"adce"  ,
"Aggressive Dead Code Elimination ,
false  ,
false   
)

Referenced by llvm::ADCEPass::run().

◆ isUnconditionalBranch()

static bool isUnconditionalBranch ( Instruction Term)
static

Definition at line 209 of file ADCE.cpp.

References llvm::DomTreeUpdater::applyUpdates(), assert(), llvm::ISD::BR, llvm::IDFCalculator< NodeTy, IsPostDom >::calculate(), Callee, llvm::IRBuilder< T, Inserter >::CreateBr(), llvm::dbgs(), llvm::DominatorTreeBase< BasicBlock, false >::Delete, llvm::depth_first(), llvm::depth_first_ext(), llvm::User::dropAllReferences(), llvm::Value::dump(), llvm::dyn_cast(), llvm::DomTreeUpdater::Eager, llvm::sys::path::end(), llvm::StringRef::equals(), llvm::Instruction::eraseFromParent(), F(), llvm::find(), llvm::Instruction::getDebugLoc(), llvm::getInstrProfValueProfFuncName(), llvm::Value::getName(), llvm::Instruction::getParent(), llvm::DIScope::getScope(), llvm::BasicBlock::getTerminator(), I, Info, initialize(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::instructions(), llvm::inverse_post_order_ext(), isAlwaysLive(), llvm::Instruction::isEHPad(), llvm::Instruction::isTerminator(), LLVM_DEBUG, llvm::AArch64CC::LS, llvm::Instruction::mayHaveSideEffects(), llvm::User::operands(), llvm::predecessors(), llvm::SmallVectorTemplateBase< T >::push_back(), RemoveControlFlowFlag, RemoveLoops, llvm::Instruction::setDebugLoc(), llvm::IDFCalculator< NodeTy, IsPostDom >::setDefiningBlocks(), llvm::IDFCalculator< NodeTy, IsPostDom >::setLiveInBlocks(), llvm::Instruction::setSuccessor(), llvm::succ_begin(), llvm::succ_end(), and llvm::successors().

Referenced by createARMMCRelocationInfo(), createBPFMCInstPrinter(), and llvm::Hexagon_MC::GetELFFlags().

◆ STATISTIC() [1/2]

STATISTIC ( NumRemoved  ,
"Number of instructions removed"   
)

◆ STATISTIC() [2/2]

STATISTIC ( NumBranchesRemoved  ,
"Number of branch instructions removed"   
)

Variable Documentation

◆ adce

adce

Definition at line 731 of file ADCE.cpp.

◆ Elimination

Aggressive Dead Code Elimination

Definition at line 731 of file ADCE.cpp.

◆ false

Aggressive Dead Code false

Definition at line 731 of file ADCE.cpp.

◆ RemoveControlFlowFlag

cl::opt<bool> RemoveControlFlowFlag("adce-remove-control-flow", cl::init(true), cl::Hidden)
static

◆ RemoveLoops

cl::opt<bool> RemoveLoops("adce-remove-loops", cl::init(false), cl::Hidden)
static

Referenced by isUnconditionalBranch().