retdec
|
Functions | |
bool | optimize (llvm::Instruction *insn, ReachingDefinitionsAnalysis &RDA, Abi *abi, std::unordered_set< llvm::Value * > *toRemove=nullptr) |
bool | unusedStores (llvm::Instruction *insn, ReachingDefinitionsAnalysis &RDA) |
bool | usesWithOneDefInSameBb (llvm::Instruction *insn, ReachingDefinitionsAnalysis &RDA) |
bool | defWithUsesInTheSameBb (llvm::Instruction *insn, ReachingDefinitionsAnalysis &RDA, Abi *abi, std::unordered_set< llvm::Value * > *toRemove) |
Variables | |
std::vector< bool(*)(llvm::Instruction *, ReachingDefinitionsAnalysis &, Abi *, std::unordered_set< llvm::Value * > *)> | optimizations |
bool retdec::bin2llvmir::inst_opt_rda::defWithUsesInTheSameBb | ( | llvm::Instruction * | insn, |
ReachingDefinitionsAnalysis & | RDA, | ||
Abi * | abi, | ||
std::unordered_set< llvm::Value * > * | toRemove | ||
) |
bool retdec::bin2llvmir::inst_opt_rda::optimize | ( | llvm::Instruction * | insn, |
ReachingDefinitionsAnalysis & | RDA, | ||
Abi * | abi, | ||
std::unordered_set< llvm::Value * > * | toRemove = nullptr |
||
) |
bool retdec::bin2llvmir::inst_opt_rda::unusedStores | ( | llvm::Instruction * | insn, |
ReachingDefinitionsAnalysis & | RDA | ||
) |
store i1 a, i1* <reg/local> ... reg/local never used => remove store
bool retdec::bin2llvmir::inst_opt_rda::usesWithOneDefInSameBb | ( | llvm::Instruction * | insn, |
ReachingDefinitionsAnalysis & | RDA | ||
) |
bb: store i32 a, i32* reg ... ; There is a single definition for this reg use in the same BB ; before/above this use. b = load i32, i32* reg ==> bb: ; Even this is removed, if this definition has no other use than the ; load we just eliminated. store i32 a, i32* reg ... ; replace uses of b with a
std::vector<bool (*)( llvm::Instruction*, ReachingDefinitionsAnalysis&, Abi*, std::unordered_set<llvm::Value*>* )> retdec::bin2llvmir::inst_opt_rda::optimizations |
Order here is important. More specific patterns must go first, more general later.