30 #define DEBUG_TYPE "adce"
32 STATISTIC(NumRemoved,
"Number of instructions removed");
50 INITIALIZE_PASS(ADCE,
"adce",
"Aggressive Dead Code Elimination",
false,
false)
53 if (skipOptnoneFunction(F))
61 if (isa<TerminatorInst>(
I) || isa<DbgInfoIntrinsic>(
I) ||
62 isa<LandingPadInst>(
I) ||
I.mayHaveSideEffects()) {
69 while (!Worklist.
empty()) {
73 if (Alive.
insert(Inst).second)
85 I.dropAllReferences();
94 return !Worklist.empty();
void push_back(const T &Elt)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
STATISTIC(NumFunctions,"Total number of functions")
size_type count(PtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
T LLVM_ATTRIBUTE_UNUSED_RESULT pop_back_val()
A Use represents the edge between a Value definition and its users.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void setPreservesCFG()
This function should be called by the pass, iff they do not:
FunctionPass * createAggressiveDCEPass()
iterator_range< inst_iterator > inst_range(Function *F)
void initializeADCEPass(PassRegistry &)