LLVM API Documentation

IntrinsicLowering.cpp File Reference

#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/Type.h"
#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/Support/IRBuilder.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetData.h"
#include "llvm/ADT/SmallVector.h"

Include dependency graph for IntrinsicLowering.cpp:

Go to the source code of this file.

Functions

template<class ArgIt>
static void EnsureFunctionExists (Module &M, const char *Name, ArgIt ArgBegin, ArgIt ArgEnd, const Type *RetTy)
static void EnsureFPIntrinsicsExist (Module &M, Function *Fn, const char *FName, const char *DName, const char *LDName)
template<class ArgIt>
static CallInst * ReplaceCallWith (const char *NewFn, CallInst *CI, ArgIt ArgBegin, ArgIt ArgEnd, const Type *RetTy)
static Value * LowerBSWAP (LLVMContext &Context, Value *V, Instruction *IP)
static Value * LowerCTPOP (LLVMContext &Context, Value *V, Instruction *IP)
static Value * LowerCTLZ (LLVMContext &Context, Value *V, Instruction *IP)
static void ReplaceFPIntrinsicWithCall (CallInst *CI, const char *Fname, const char *Dname, const char *LDname)


Function Documentation

static void EnsureFPIntrinsicsExist ( Module &  M,
Function *  Fn,
const char *  FName,
const char *  DName,
const char *  LDName 
) [static]

template<class ArgIt>
static void EnsureFunctionExists ( Module &  M,
const char *  Name,
ArgIt  ArgBegin,
ArgIt  ArgEnd,
const Type *  RetTy 
) [inline, static]

static Value* LowerBSWAP ( LLVMContext &  Context,
Value *  V,
Instruction *  IP 
) [static]

static Value* LowerCTLZ ( LLVMContext &  Context,
Value *  V,
Instruction *  IP 
) [static]

static Value* LowerCTPOP ( LLVMContext &  Context,
Value *  V,
Instruction *  IP 
) [static]

template<class ArgIt>
static CallInst* ReplaceCallWith ( const char *  NewFn,
CallInst *  CI,
ArgIt  ArgBegin,
ArgIt  ArgEnd,
const Type *  RetTy 
) [inline, static]

ReplaceCallWith - This function is used when we want to lower an intrinsic call to a call of an external function. This handles hard cases such as when there was already a prototype for the external function, and if that prototype doesn't match the arguments we expect to pass in.

Definition at line 63 of file IntrinsicLowering.cpp.

References Builder, llvm::IRBuilder< preserveNames, T >::CreateCall(), llvm::Value::getName(), llvm::Module::getOrInsertFunction(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), M, llvm::Value::replaceAllUsesWith(), llvm::Value::setName(), and llvm::Value::use_empty().

Referenced by llvm::IntrinsicLowering::LowerIntrinsicCall(), and ReplaceFPIntrinsicWithCall().

static void ReplaceFPIntrinsicWithCall ( CallInst *  CI,
const char *  Fname,
const char *  Dname,
const char *  LDname 
) [static]