LLVM
8.0.1
|
#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"
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 | setOnlyReadsMemory (Function &F, unsigned ArgNo) |
static bool | setRetNonNull (Function &F) |
static bool | setReturnedArg (Function &F, unsigned ArgNo) |
static bool | setNonLazyBind (Function &F) |
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) |
#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 949 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 963 of file BuildLibCalls.cpp.
References assert(), Callee, llvm::IRBuilder< T, Inserter >::CreateCall(), F(), llvm::AttributeList::FunctionIndex, llvm::IRBuilderBase::getContext(), llvm::IRBuilderBase::GetInsertBlock(), llvm::BasicBlock::getModule(), llvm::Module::getOrInsertFunction(), llvm::Value::getType(), llvm::AttributeList::removeAttribute(), llvm::CallBase::setAttributes(), llvm::CallBase::setCallingConv(), llvm::Attribute::Speculatable, 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<>::setDoesNotAccessMemory().
Definition at line 83 of file BuildLibCalls.cpp.
References llvm::Function::addParamAttr(), llvm::Function::hasParamAttribute(), and llvm::Attribute::NoCapture.
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<>::setDoesNotThrow().
Definition at line 117 of file BuildLibCalls.cpp.
References llvm::Function::addFnAttr(), llvm::Function::hasFnAttribute(), and llvm::Attribute::NonLazyBind.
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<>::setOnlyAccessesArgMemory().
Definition at line 51 of file BuildLibCalls.cpp.
References llvm::Function::onlyReadsMemory(), and llvm::Function::setOnlyReadsMemory().
Referenced by llvm::inferLibFuncAttributes(), and llvm::CallSiteBase<>::setOnlyReadsMemory().
Definition at line 91 of file BuildLibCalls.cpp.
References llvm::Function::addParamAttr(), llvm::Function::hasParamAttribute(), and llvm::Attribute::ReadOnly.
Definition at line 75 of file BuildLibCalls.cpp.
References llvm::Function::addAttribute(), llvm::Function::hasAttribute(), llvm::Attribute::NoAlias, and llvm::AttributeList::ReturnIndex.
Referenced by llvm::inferLibFuncAttributes().
Definition at line 99 of file BuildLibCalls.cpp.
References llvm::Function::addAttribute(), assert(), llvm::Function::getReturnType(), llvm::Function::hasAttribute(), llvm::Type::isPointerTy(), llvm::Attribute::NonNull, and llvm::AttributeList::ReturnIndex.
Referenced by llvm::inferLibFuncAttributes().
Definition at line 109 of file BuildLibCalls.cpp.
References llvm::Function::addParamAttr(), llvm::Function::hasParamAttribute(), and llvm::Attribute::Returned.
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" | |||
) |