retdec
Protected Member Functions | Friends | List of all members
retdec::bin2llvmir::IdiomsLLVM Class Reference

clang/LLVM instruction idioms More...

#include <idioms_llvm.h>

Inheritance diagram for retdec::bin2llvmir::IdiomsLLVM:
Inheritance graph
[legend]
Collaboration diagram for retdec::bin2llvmir::IdiomsLLVM:
Collaboration graph
[legend]

Protected Member Functions

llvm::Instruction * exchangeIsGreaterThanMinusOne (llvm::BasicBlock::iterator iter) const
 
llvm::Instruction * exchangeCompareEq (llvm::BasicBlock::iterator iter) const
 
llvm::Instruction * exchangeCompareNeq (llvm::BasicBlock::iterator iter) const
 
llvm::Instruction * exchangeCompareSlt (llvm::BasicBlock::iterator iter) const
 
llvm::Instruction * exchangeCompareSle (llvm::BasicBlock::iterator iter) const
 
- Protected Member Functions inherited from retdec::bin2llvmir::IdiomsAbstract
 IdiomsAbstract ()
 
void init (llvm::Module *M, CC_compiler cc, CC_arch arch)
 
CC_compiler getCompiler () const
 
CC_arch getArch () const
 
llvm::Module * getModule () const
 
virtual bool doAnalysis (llvm::Function &, llvm::Pass *)=0
 
virtual ~IdiomsAbstract ()=default
 
bool findBranchDependingOn (llvm::BranchInst **br, llvm::BasicBlock &bb, const llvm::Value *val) const
 

Friends

class IdiomsAnalysis
 

Additional Inherited Members

- Static Protected Member Functions inherited from retdec::bin2llvmir::IdiomsAbstract
static void eraseInstFromBasicBlock (llvm::Value *val, llvm::BasicBlock *bb)
 
static bool isPowerOfTwo (unsigned x)
 
static bool isPowerOfTwoRepresentable (const llvm::ConstantInt *cnst)
 

Detailed Description

clang/LLVM instruction idioms

Member Function Documentation

◆ exchangeCompareEq()

Instruction * retdec::bin2llvmir::IdiomsLLVM::exchangeCompareEq ( llvm::BasicBlock::iterator  iter) const
protected

Exchange ~(A^B) with icmp eq i1 A, B

Parameters
itervalue to visit
Returns
replaced Instruction, otherwise nullptr

◆ exchangeCompareNeq()

Instruction * retdec::bin2llvmir::IdiomsLLVM::exchangeCompareNeq ( llvm::BasicBlock::iterator  iter) const
protected

Exchange A^B with icmp eq i1 A, B

Parameters
itervalue to visit
Returns
replaced Instruction, otherwise nullptr

◆ exchangeCompareSle()

Instruction * retdec::bin2llvmir::IdiomsLLVM::exchangeCompareSle ( llvm::BasicBlock::iterator  iter) const
protected

Exchange ~A | B with icmp sle i1 A, B

Parameters
itervalue to visit
Returns
replaced Instruction, otherwise nullptr

◆ exchangeCompareSlt()

Instruction * retdec::bin2llvmir::IdiomsLLVM::exchangeCompareSlt ( llvm::BasicBlock::iterator  iter) const
protected

Exchange ~A & B with icmp slt i1 A, B

Parameters
itervalue to visit
Returns
replaced Instruction, otherwise nullptr

◆ exchangeIsGreaterThanMinusOne()

Instruction * retdec::bin2llvmir::IdiomsLLVM::exchangeIsGreaterThanMinusOne ( llvm::BasicBlock::iterator  iter) const
protected

Exchange (X & SignBit) == 0 with X > -1

Parameters
itervalue to visit
Returns
replaced Instruction, otherwise nullptr

Friends And Related Function Documentation

◆ IdiomsAnalysis

friend class IdiomsAnalysis
friend

The documentation for this class was generated from the following files: