17 #define DEBUG_TYPE "instsimplify"
32 STATISTIC(NumSimplified,
"Number of redundant instructions removed");
48 const DominatorTree *DT = getAnalysisIfAvailable<DominatorTree>();
49 const DataLayout *
TD = getAnalysisIfAvailable<DataLayout>();
62 if (!ToSimplify->empty() && !ToSimplify->count(I))
70 Next->insert(cast<Instruction>(*UI));
82 }
while (!ToSimplify->empty());
91 "Remove redundant instructions",
false,
false)
99 return new InstSimplifier();
static PassRegistry * getPassRegistry()
bool RecursivelyDeleteTriviallyDeadInstructions(Value *V, const TargetLibraryInfo *TLI=0)
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
ID
LLVM Calling Convention Representation.
char & InstructionSimplifierID
INITIALIZE_PASS_BEGIN(InstSimplifier,"instsimplify","Remove redundant instructions", false, false) INITIALIZE_PASS_END(InstSimplifier
void replaceAllUsesWith(Value *V)
df_iterator< T > df_end(const T &G)
void initializeInstSimplifierPass(PassRegistry &)
Value * SimplifyInstruction(Instruction *I, const DataLayout *TD=0, const TargetLibraryInfo *TLI=0, const DominatorTree *DT=0)
STATISTIC(NumSimplified,"Number of redundant instructions removed")
const BasicBlock & getEntryBlock() const
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
df_iterator< T > df_begin(const T &G)
LLVM Value Representation.
FunctionPass * createInstructionSimplifierPass()
Remove redundant instructions
INITIALIZE_PASS(GlobalMerge,"global-merge","Global Merge", false, false) bool GlobalMerge const DataLayout * TD