|
LLVM
10.0.0
|
#include "llvm/Transforms/Utils/BuildLibCalls.h"#include "llvm/ADT/SmallString.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/Function.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Module.h"#include "llvm/IR/Type.h"#include "llvm/Analysis/MemoryBuiltins.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "build-libcalls" |
Functions | |
| STATISTIC (NumReadNone, "Number of functions inferred as readnone") | |
| STATISTIC (NumReadOnly, "Number of functions inferred as readonly") | |
| STATISTIC (NumArgMemOnly, "Number of functions inferred as argmemonly") | |
| STATISTIC (NumNoUnwind, "Number of functions inferred as nounwind") | |
| STATISTIC (NumNoCapture, "Number of arguments inferred as nocapture") | |
| STATISTIC (NumReadOnlyArg, "Number of arguments inferred as readonly") | |
| STATISTIC (NumNoAlias, "Number of function returns inferred as noalias") | |
| STATISTIC (NumNonNull, "Number of function returns inferred as nonnull returns") | |
| STATISTIC (NumReturnedArg, "Number of arguments inferred as returned") | |
| static bool | setDoesNotAccessMemory (Function &F) |
| static bool | setOnlyReadsMemory (Function &F) |
| static bool | setOnlyAccessesArgMemory (Function &F) |
| static bool | setDoesNotThrow (Function &F) |
| static bool | setRetDoesNotAlias (Function &F) |
| static bool | setDoesNotCapture (Function &F, unsigned ArgNo) |
| static bool | setDoesNotAlias (Function &F, unsigned ArgNo) |
| static bool | setOnlyReadsMemory (Function &F, unsigned ArgNo) |
| static bool | setRetNonNull (Function &F) |
| static bool | setReturnedArg (Function &F, unsigned ArgNo) |
| static bool | setNonLazyBind (Function &F) |
| static bool | setDoesNotFreeMemory (Function &F) |
| static Value * | emitLibCall (LibFunc TheLibFunc, Type *ReturnType, ArrayRef< Type *> ParamTypes, ArrayRef< Value *> Operands, IRBuilder<> &B, const TargetLibraryInfo *TLI, bool IsVaArgs=false) |
| static void | appendTypeSuffix (Value *Op, StringRef &Name, SmallString< 20 > &NameBuffer) |
| Append a suffix to the function name according to the type of 'Op'. More... | |
| static Value * | emitUnaryFloatFnCallHelper (Value *Op, StringRef Name, IRBuilder<> &B, const AttributeList &Attrs) |
| static Value * | emitBinaryFloatFnCallHelper (Value *Op1, Value *Op2, StringRef Name, IRBuilder<> &B, const AttributeList &Attrs) |
| #define DEBUG_TYPE "build-libcalls" |
Definition at line 29 of file BuildLibCalls.cpp.
|
static |
Append a suffix to the function name according to the type of 'Op'.
Definition at line 1028 of file BuildLibCalls.cpp.
References llvm::Value::getType(), llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), and Name.
Referenced by llvm::emitBinaryFloatFnCall(), and llvm::emitUnaryFloatFnCall().
|
static |
Definition at line 1084 of file BuildLibCalls.cpp.
References assert(), Callee, llvm::IRBuilder< T, Inserter >::CreateCall(), F(), llvm::AttributeList::FunctionIndex, llvm::FunctionCallee::getCallee(), llvm::IRBuilderBase::getContext(), llvm::IRBuilderBase::GetInsertBlock(), llvm::BasicBlock::getModule(), llvm::Module::getOrInsertFunction(), llvm::Value::getType(), Name, llvm::AttributeList::removeAttribute(), llvm::CallBase::setAttributes(), llvm::CallBase::setCallingConv(), and llvm::Value::stripPointerCasts().
Referenced by llvm::emitBinaryFloatFnCall().
|
static |
Definition at line 827 of file BuildLibCalls.cpp.
References Callee, llvm::IRBuilder< T, Inserter >::CreateCall(), F(), llvm::FunctionType::get(), llvm::FunctionCallee::getCallee(), llvm::IRBuilderBase::GetInsertBlock(), llvm::BasicBlock::getModule(), llvm::TargetLibraryInfo::getName(), llvm::Module::getOrInsertFunction(), llvm::TargetLibraryInfo::has(), llvm::inferLibFuncAttributes(), llvm::CallBase::setCallingConv(), and llvm::Value::stripPointerCasts().
Referenced by llvm::emitBCmp(), llvm::emitMemCCpy(), llvm::emitMemChr(), llvm::emitMemCmp(), llvm::emitSNPrintf(), llvm::emitSPrintf(), llvm::emitStpCpy(), llvm::emitStpNCpy(), llvm::emitStrCat(), llvm::emitStrChr(), llvm::emitStrCpy(), llvm::emitStrDup(), llvm::emitStrLCat(), llvm::emitStrLCpy(), llvm::emitStrLen(), llvm::emitStrNCat(), llvm::emitStrNCmp(), llvm::emitStrNCpy(), llvm::emitVSNPrintf(), and llvm::emitVSPrintf().
|
static |
Definition at line 1042 of file BuildLibCalls.cpp.
References assert(), Callee, llvm::IRBuilder< T, Inserter >::CreateCall(), F(), llvm::AttributeList::FunctionIndex, llvm::FunctionCallee::getCallee(), llvm::IRBuilderBase::getContext(), llvm::IRBuilderBase::GetInsertBlock(), llvm::BasicBlock::getModule(), llvm::Module::getOrInsertFunction(), llvm::Value::getType(), llvm::AttributeList::removeAttribute(), llvm::CallBase::setAttributes(), llvm::CallBase::setCallingConv(), and llvm::Value::stripPointerCasts().
Referenced by llvm::emitUnaryFloatFnCall().
Definition at line 43 of file BuildLibCalls.cpp.
References llvm::Function::doesNotAccessMemory(), and llvm::Function::setDoesNotAccessMemory().
Referenced by llvm::inferLibFuncAttributes(), and llvm::CallSiteBase< Function, BasicBlock, Value, User, Use, Instruction, CallInst, InvokeInst, CallBrInst, User::op_iterator >::setDoesNotAccessMemory().
Definition at line 91 of file BuildLibCalls.cpp.
References llvm::Function::addParamAttr(), llvm::Function::hasParamAttribute(), and llvm::NoAlias.
Referenced by llvm::inferLibFuncAttributes().
Definition at line 83 of file BuildLibCalls.cpp.
References llvm::Function::addParamAttr(), and llvm::Function::hasParamAttribute().
Referenced by llvm::inferLibFuncAttributes().
Definition at line 132 of file BuildLibCalls.cpp.
References llvm::Function::addFnAttr(), and llvm::Function::hasFnAttribute().
Referenced by llvm::inferLibFuncAttributes().
Definition at line 67 of file BuildLibCalls.cpp.
References llvm::Function::doesNotThrow(), and llvm::Function::setDoesNotThrow().
Referenced by llvm::createObjCARCOptPass(), llvm::inferLibFuncAttributes(), and llvm::CallSiteBase< Function, BasicBlock, Value, User, Use, Instruction, CallInst, InvokeInst, CallBrInst, User::op_iterator >::setDoesNotThrow().
Definition at line 125 of file BuildLibCalls.cpp.
References llvm::Function::addFnAttr(), and llvm::Function::hasFnAttribute().
Referenced by llvm::inferLibFuncAttributes(), and lowerObjCCall().
Definition at line 59 of file BuildLibCalls.cpp.
References llvm::Function::onlyAccessesArgMemory(), and llvm::Function::setOnlyAccessesArgMemory().
Referenced by llvm::inferLibFuncAttributes(), and llvm::CallSiteBase< Function, BasicBlock, Value, User, Use, Instruction, CallInst, InvokeInst, CallBrInst, User::op_iterator >::setOnlyAccessesArgMemory().
Definition at line 51 of file BuildLibCalls.cpp.
References llvm::Function::onlyReadsMemory(), and llvm::Function::setOnlyReadsMemory().
Referenced by llvm::inferLibFuncAttributes(), and llvm::CallSiteBase< Function, BasicBlock, Value, User, Use, Instruction, CallInst, InvokeInst, CallBrInst, User::op_iterator >::setOnlyReadsMemory().
Definition at line 99 of file BuildLibCalls.cpp.
References llvm::Function::addParamAttr(), and llvm::Function::hasParamAttribute().
Definition at line 75 of file BuildLibCalls.cpp.
References llvm::Function::addAttribute(), llvm::Function::hasAttribute(), llvm::NoAlias, and llvm::AttributeList::ReturnIndex.
Referenced by llvm::inferLibFuncAttributes().
Definition at line 107 of file BuildLibCalls.cpp.
References llvm::Function::addAttribute(), assert(), llvm::Function::getReturnType(), llvm::Function::hasAttribute(), llvm::Type::isPointerTy(), and llvm::AttributeList::ReturnIndex.
Referenced by llvm::inferLibFuncAttributes().
Definition at line 117 of file BuildLibCalls.cpp.
References llvm::Function::addParamAttr(), and llvm::Function::hasParamAttribute().
Referenced by llvm::inferLibFuncAttributes().
| STATISTIC | ( | NumReadNone | , |
| "Number of functions inferred as readnone" | |||
| ) |
| STATISTIC | ( | NumReadOnly | , |
| "Number of functions inferred as readonly" | |||
| ) |
| STATISTIC | ( | NumArgMemOnly | , |
| "Number of functions inferred as argmemonly" | |||
| ) |
| STATISTIC | ( | NumNoUnwind | , |
| "Number of functions inferred as nounwind" | |||
| ) |
| STATISTIC | ( | NumNoCapture | , |
| "Number of arguments inferred as nocapture" | |||
| ) |
| STATISTIC | ( | NumReadOnlyArg | , |
| "Number of arguments inferred as readonly" | |||
| ) |
| STATISTIC | ( | NumNoAlias | , |
| "Number of function returns inferred as noalias" | |||
| ) |
| STATISTIC | ( | NumNonNull | , |
| "Number of function returns inferred as nonnull returns" | |||
| ) |
| STATISTIC | ( | NumReturnedArg | , |
| "Number of arguments inferred as returned" | |||
| ) |
1.8.13