class LibCallSimplifier
Declaration
class LibCallSimplifier { /* full declaration omitted */ };
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!")'.
Declared at: llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h:100
Method Overview
- public LibCallSimplifier(const llvm::DataLayout & DL, const llvm::TargetLibraryInfo * TLI, llvm::OptimizationRemarkEmitter & ORE, llvm::BlockFrequencyInfo * BFI, llvm::ProfileSummaryInfo * PSI, function_ref<void (llvm::Instruction *, llvm::Value *)> Replacer = &replaceAllUsesWithDefault, function_ref<void (llvm::Instruction *)> Eraser = &eraseFromParentDefault)
- public llvm::Value * optimizeCall(llvm::CallInst * CI)
Methods
¶LibCallSimplifier(
const llvm::DataLayout& DL,
const llvm::TargetLibraryInfo* TLI,
llvm::OptimizationRemarkEmitter& ORE,
llvm::BlockFrequencyInfo* BFI,
llvm::ProfileSummaryInfo* PSI,
function_ref<void(llvm::Instruction*,
llvm::Value*)> Replacer =
&replaceAllUsesWithDefault,
function_ref<void(llvm::Instruction*)>
Eraser = &eraseFromParentDefault)
LibCallSimplifier(
const llvm::DataLayout& DL,
const llvm::TargetLibraryInfo* TLI,
llvm::OptimizationRemarkEmitter& ORE,
llvm::BlockFrequencyInfo* BFI,
llvm::ProfileSummaryInfo* PSI,
function_ref<void(llvm::Instruction*,
llvm::Value*)> Replacer =
&replaceAllUsesWithDefault,
function_ref<void(llvm::Instruction*)>
Eraser = &eraseFromParentDefault)
Declared at: llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h:138
Parameters
- const llvm::DataLayout& DL
- const llvm::TargetLibraryInfo* TLI
- llvm::OptimizationRemarkEmitter& ORE
- llvm::BlockFrequencyInfo* BFI
- llvm::ProfileSummaryInfo* PSI
- function_ref<void(llvm::Instruction*, llvm::Value*)> Replacer = &replaceAllUsesWithDefault
- function_ref<void(llvm::Instruction*)> Eraser = &eraseFromParentDefault
¶llvm::Value* optimizeCall(llvm::CallInst* CI)
llvm::Value* optimizeCall(llvm::CallInst* CI)
Description
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.
Declared at: llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h:153
Parameters
- llvm::CallInst* CI