LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::LibCallSimplifier Class Reference

#include <SimplifyLibCalls.h>

Public Member Functions

 LibCallSimplifier (const DataLayout *TD, const TargetLibraryInfo *TLI, bool UnsafeFPShrink)
 
virtual ~LibCallSimplifier ()
 
ValueoptimizeCall (CallInst *CI)
 
virtual void replaceAllUsesWith (Instruction *I, Value *With) const
 

Detailed Description

LibCallSimplifier - This class implements a collection of optimizations that replace well formed calls to library functions with a more optimal form. For example, replacing 'printf("Hello!")' with 'puts("Hello!")'.

Definition at line 29 of file SimplifyLibCalls.h.

Constructor & Destructor Documentation

llvm::LibCallSimplifier::LibCallSimplifier ( const DataLayout TD,
const TargetLibraryInfo TLI,
bool  UnsafeFPShrink 
)

Definition at line 2183 of file SimplifyLibCalls.cpp.

llvm::LibCallSimplifier::~LibCallSimplifier ( )
virtual

Definition at line 2189 of file SimplifyLibCalls.cpp.

Member Function Documentation

Value * llvm::LibCallSimplifier::optimizeCall ( CallInst CI)

optimizeCall - Take the given call instruction and return a more optimal value to replace the instruction with or 0 if a more optimal form can't be found. Note that the returned value may be equal to the instruction being optimized. In this case all other instructions that use the given instruction were modified and the given instruction is dead.

Definition at line 2193 of file SimplifyLibCalls.cpp.

References llvm::CallInst::isNoBuiltin(), and llvm::LibCallSimplifierImpl::optimizeCall().

void llvm::LibCallSimplifier::replaceAllUsesWith ( Instruction I,
Value With 
) const
virtual

replaceAllUsesWith - This method is used when the library call simplifier needs to replace instructions other than the library call being modified.

Definition at line 2198 of file SimplifyLibCalls.cpp.

References llvm::Instruction::eraseFromParent(), and llvm::Value::replaceAllUsesWith().


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