LLVM API Documentation
#include <SimplifyLibCalls.h>
Public Member Functions | |
LibCallSimplifier (const DataLayout *TD, const TargetLibraryInfo *TLI, bool UnsafeFPShrink) | |
Value * | optimizeCall (CallInst *CI) |
virtual void | replaceAllUsesWith (Instruction *I, Value *With) const |
Protected Member Functions | |
~LibCallSimplifier () |
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 33 of file SimplifyLibCalls.h.
llvm::LibCallSimplifier::~LibCallSimplifier | ( | ) | [inline, protected] |
Definition at line 40 of file SimplifyLibCalls.h.
LibCallSimplifier::LibCallSimplifier | ( | const DataLayout * | TD, |
const TargetLibraryInfo * | TLI, | ||
bool | UnsafeFPShrink | ||
) |
Definition at line 2069 of file SimplifyLibCalls.cpp.
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.
Definition at line 1877 of file SimplifyLibCalls.cpp.
References llvm::LibFunc::abs, llvm::LibFunc::acos, llvm::LibFunc::acosh, llvm::LibFunc::asin, llvm::LibFunc::asinh, llvm::LibFunc::atan, llvm::LibFunc::atanh, llvm::CallingConv::C, llvm::LibFunc::cbrt, llvm::LibFunc::ceil, llvm::LibFunc::cos, llvm::LibFunc::cosf, llvm::LibFunc::cosh, llvm::LibFunc::cosl, llvm::LibFunc::cospi, llvm::LibFunc::cospif, llvm::StringRef::endswith(), llvm::LibFunc::exp, llvm::LibFunc::exp10, llvm::LibFunc::exp2, llvm::LibFunc::exp2l, llvm::LibFunc::expm1, llvm::LibFunc::fabs, llvm::LibFunc::ffs, llvm::LibFunc::ffsl, llvm::LibFunc::ffsll, llvm::LibFunc::fiprintf, llvm::LibFunc::floor, llvm::LibFunc::fmax, llvm::LibFunc::fmin, llvm::LibFunc::fprintf, llvm::LibFunc::fputc, llvm::LibFunc::fputs, llvm::LibFunc::fwrite, llvm::CallInst::getCalledFunction(), llvm::CallInst::getCallingConv(), llvm::TargetLibraryInfo::getLibFunc(), llvm::Value::getName(), llvm::TargetLibraryInfo::has(), ignoreCallingConv(), llvm::LibFunc::isascii, llvm::LibFunc::isdigit, llvm::CallInst::isNoBuiltin(), llvm::LibFunc::labs, llvm::LibFunc::llabs, llvm::LibFunc::log, llvm::LibFunc::log10, llvm::LibFunc::log1p, llvm::LibFunc::log2, llvm::LibFunc::logb, llvm::LibFunc::memcmp, llvm::LibFunc::memcpy, llvm::LibFunc::memcpy_chk, llvm::LibFunc::memmove, llvm::LibFunc::memset, llvm::LibFunc::nearbyint, llvm::LibFunc::perror, llvm::LibFunc::pow, llvm::LibFunc::powf, llvm::LibFunc::powl, llvm::LibFunc::printf, llvm::LibFunc::puts, llvm::LibFunc::rint, llvm::LibFunc::round, llvm::LibFunc::sin, llvm::LibFunc::sinh, llvm::LibFunc::sinpi, llvm::LibFunc::sinpif, llvm::LibFunc::sprintf, llvm::LibFunc::sqrt, llvm::LibFunc::stpcpy, llvm::LibFunc::strcat, llvm::LibFunc::strchr, llvm::LibFunc::strcmp, llvm::LibFunc::strcpy, llvm::LibFunc::strcspn, llvm::LibFunc::strlen, llvm::LibFunc::strncat, llvm::LibFunc::strncmp, llvm::LibFunc::strncpy, llvm::LibFunc::strpbrk, llvm::LibFunc::strrchr, llvm::LibFunc::strspn, llvm::LibFunc::strstr, llvm::LibFunc::strtod, llvm::LibFunc::strtof, llvm::LibFunc::strtol, llvm::LibFunc::strtold, llvm::LibFunc::strtoll, llvm::LibFunc::strtoul, llvm::LibFunc::strtoull, llvm::LibFunc::tan, llvm::LibFunc::tanh, llvm::LibFunc::toascii, llvm::LibFunc::trunc, and llvm::LibFunc::vfprintf.
void 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 2077 of file SimplifyLibCalls.cpp.
References llvm::Instruction::eraseFromParent(), and llvm::Value::replaceAllUsesWith().