LLVM API Documentation

DeadArgumentElimination.cpp File Reference

#include "llvm/Transforms/IPO.h"
#include "llvm/CallingConv.h"
#include "llvm/Constant.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Compiler.h"
#include <map>
#include <set>

Include dependency graph for DeadArgumentElimination.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "deadargelim"

Functions

 STATISTIC (NumArgumentsEliminated,"Number of unread args removed")
 STATISTIC (NumRetValsEliminated,"Number of unused return values removed")
ModulePass * llvm::createDeadArgEliminationPass ()
ModulePass * llvm::createDeadArgHackingPass ()
static unsigned NumRetVals (const Function *F)

Variables

static RegisterPass< DAE > X ("deadargelim","Dead Argument Elimination")
static RegisterPass< DAH > Y ("deadarghaX0r","Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)")


Define Documentation

#define DEBUG_TYPE   "deadargelim"

Definition at line 20 of file DeadArgumentElimination.cpp.


Function Documentation

static unsigned NumRetVals ( const Function *  F  )  [static]

Convenience function that returns the number of return values. It returns 0 for void functions and 1 for functions not returning a struct. It returns the number of struct elements for functions returning a struct.

Definition at line 286 of file DeadArgumentElimination.cpp.

References llvm::Function::getReturnType(), and llvm::Type::VoidTy.

STATISTIC ( NumRetValsEliminated  ,
"Number of unused return values removed"   
)

STATISTIC ( NumArgumentsEliminated  ,
"Number of unread args removed"   
)


Variable Documentation

const Function* F

Definition at line 54 of file DeadArgumentElimination.cpp.

char ID [static]

Definition at line 123 of file DeadArgumentElimination.cpp.

bool IsArg

Definition at line 56 of file DeadArgumentElimination.cpp.

LiveFuncSet LiveFunctions

This set contains all values that are cannot be changed in any way.

Definition at line 118 of file DeadArgumentElimination.cpp.

LiveSet LiveValues

This set contains all values that have been determined to be live.

Definition at line 116 of file DeadArgumentElimination.cpp.

UseMap Uses

This maps a return value or argument to any MaybeLive return values or arguments it uses. This allows the MaybeLive values to be marked live when any of its users is marked live. For example (indices are left out for clarity):

  • Uses[ret F] = ret G This means that F calls G, and F returns the value returned by G.
  • Uses[arg F] = ret G This means that some function calls G and passes its result as an argument to F.
  • Uses[ret F] = arg F This means that F returns one of its own arguments.
  • Uses[arg F] = arg G This means that G calls F and passes one of its own (G's) arguments directly to F.

Definition at line 110 of file DeadArgumentElimination.cpp.

Referenced by llvm::SelectionDAG::ReplaceAllUsesOfValuesWith().

RegisterPass<DAE> X("deadargelim","Dead Argument Elimination") [static]

RegisterPass<DAH> Y("deadarghaX0r","Dead Argument Hacking (BUGPOINT USE ONLY; DO NOT USE)") [static]