LLVM  3.7.0
Public Member Functions | List of all members
llvm::LibCallSimplifier Class Reference

LibCallSimplifier - This class implements a collection of optimizations that replace well formed calls to library functions with a more optimal form. More...

#include <SimplifyLibCalls.h>

Public Member Functions

 LibCallSimplifier (const DataLayout &DL, const TargetLibraryInfo *TLI, function_ref< void(Instruction *, Value *)> Replacer=&replaceAllUsesWithDefault)
 
ValueoptimizeCall (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. More...
 

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 71 of file SimplifyLibCalls.h.

Constructor & Destructor Documentation

LibCallSimplifier::LibCallSimplifier ( const DataLayout DL,
const TargetLibraryInfo TLI,
function_ref< void(Instruction *, Value *)>  Replacer = &replaceAllUsesWithDefault 
)

Definition at line 2125 of file SimplifyLibCalls.cpp.

Member Function Documentation

Value * 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. The call must not be an indirect call.

Definition at line 1958 of file SimplifyLibCalls.cpp.

References llvm::abs(), llvm::CallingConv::C, llvm::dyn_cast(), EnableUnsafeFPShrink, llvm::Instruction::eraseFromParent(), llvm::CallInst::getCalledFunction(), llvm::CallInst::getCallingConv(), llvm::Function::getFnAttribute(), llvm::Value::getName(), llvm::Attribute::getValueAsString(), llvm::Function::hasFnAttribute(), ignoreCallingConv(), llvm::CallInst::isNoBuiltin(), and llvm::Value::replaceAllUsesWith().


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