LLVM API Documentation
#include "llvm/Transforms/Utils/SimplifyLibCalls.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetLibraryInfo.h"
#include "llvm/Transforms/Utils/BuildLibCalls.h"
Go to the source code of this file.
Functions | |
static bool | ignoreCallingConv (LibFunc::Func Func) |
static bool | isOnlyUsedInZeroEqualityComparison (Value *V) |
static bool | isOnlyUsedInEqualityComparison (Value *V, Value *With) |
static bool | callHasFloatingPointArgument (const CallInst *CI) |
static bool | hasUnaryFloatFn (const TargetLibraryInfo *TLI, Type *Ty, LibFunc::Func DoubleFn, LibFunc::Func FloatFn, LibFunc::Func LongDoubleFn) |
Check whether the overloaded unary floating point function corresponing to Ty is available. | |
static bool | isFortifiedCallFoldable (CallInst *CI, unsigned SizeCIOp, unsigned SizeArgOp, bool isString) |
static bool | isTrigLibCall (CallInst *CI) |
static void | insertSinCosCall (IRBuilder<> &B, Function *OrigCallee, Value *Arg, bool UseFloat, Value *&Sin, Value *&Cos, Value *&SinCos) |
static bool | isReportingError (Function *Callee, CallInst *CI, int StreamArg) |
Variables | |
static cl::opt< bool > | ColdErrorCalls ("error-reporting-is-cold", cl::init(true), cl::Hidden, cl::desc("Treat error-reporting calls as cold")) |
static bool callHasFloatingPointArgument | ( | const CallInst * | CI | ) | [static] |
Definition at line 86 of file SimplifyLibCalls.cpp.
References llvm::User::op_begin(), and llvm::User::op_end().
static bool hasUnaryFloatFn | ( | const TargetLibraryInfo * | TLI, |
Type * | Ty, | ||
LibFunc::Func | DoubleFn, | ||
LibFunc::Func | FloatFn, | ||
LibFunc::Func | LongDoubleFn | ||
) | [static] |
Check whether the overloaded unary floating point function corresponing to Ty is available.
Definition at line 97 of file SimplifyLibCalls.cpp.
References llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::Type::getTypeID(), and llvm::TargetLibraryInfo::has().
static bool ignoreCallingConv | ( | LibFunc::Func | Func | ) | [static] |
Definition at line 45 of file SimplifyLibCalls.cpp.
References llvm::LibFunc::abs, llvm::LibFunc::labs, llvm::LibFunc::llabs, llvm_unreachable, and llvm::LibFunc::strlen.
Referenced by llvm::LibCallSimplifier::optimizeCall().
void insertSinCosCall | ( | IRBuilder<> & | B, |
Function * | OrigCallee, | ||
Value * | Arg, | ||
bool | UseFloat, | ||
Value *& | Sin, | ||
Value *& | Cos, | ||
Value *& | SinCos | ||
) | [static] |
Definition at line 1330 of file SimplifyLibCalls.cpp.
References llvm::BasicBlock::begin(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateCall(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateExtractElement(), llvm::IRBuilder< preserveNames, T, Inserter >::CreateExtractValue(), llvm::ConstantInt::get(), llvm::StructType::get(), llvm::VectorType::get(), llvm::Function::getAttributes(), llvm::Function::getEntryBlock(), llvm::IRBuilderBase::GetInsertBlock(), llvm::IRBuilderBase::getInt32Ty(), llvm::Module::getOrInsertFunction(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::Module::getTargetTriple(), llvm::Value::getType(), llvm::Type::isStructTy(), Name, llvm::IRBuilderBase::SetInsertPoint(), T, llvm::Triple::x86, and llvm::Triple::x86_64.
static bool isFortifiedCallFoldable | ( | CallInst * | CI, |
unsigned | SizeCIOp, | ||
unsigned | SizeArgOp, | ||
bool | isString | ||
) | [static] |
Definition at line 114 of file SimplifyLibCalls.cpp.
References llvm::CallInst::getArgOperand(), and llvm::GetStringLength().
static bool isOnlyUsedInEqualityComparison | ( | Value * | V, |
Value * | With | ||
) | [static] |
isOnlyUsedInEqualityComparison - Return true if it is only used in equality comparisons with With.
Definition at line 75 of file SimplifyLibCalls.cpp.
References llvm::Value::users().
static bool isOnlyUsedInZeroEqualityComparison | ( | Value * | V | ) | [static] |
isOnlyUsedInZeroEqualityComparison - Return true if it only matters that the value is equal or not-equal to zero.
Definition at line 60 of file SimplifyLibCalls.cpp.
References llvm::CallingConv::C, and llvm::Value::users().
static bool isReportingError | ( | Function * | Callee, |
CallInst * | CI, | ||
int | StreamArg | ||
) | [static] |
Definition at line 1499 of file SimplifyLibCalls.cpp.
References ColdErrorCalls, llvm::dyn_cast(), llvm::CallInst::getArgOperand(), llvm::Value::getName(), llvm::CallInst::getNumArgOperands(), llvm::LoadInst::getPointerOperand(), llvm::GlobalValue::isDeclaration(), and LI.
static bool isTrigLibCall | ( | CallInst * | CI | ) | [static] |
Definition at line 1273 of file SimplifyLibCalls.cpp.
References llvm::CallInst::getCalledFunction(), llvm::Function::getFunctionType(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getParamType(), llvm::FunctionType::getReturnType(), llvm::CallInst::hasFnAttr(), llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), llvm::Attribute::NoUnwind, and llvm::Attribute::ReadNone.
cl::opt<bool> ColdErrorCalls("error-reporting-is-cold", cl::init(true), cl::Hidden, cl::desc("Treat error-reporting calls as cold")) [static] |
Referenced by isReportingError().