LLVM API Documentation

IntrinsicLowering.cpp File Reference

#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/Instructions.h"
#include "llvm/Type.h"
#include <iostream>

Include dependency graph for IntrinsicLowering.cpp:

Go to the source code of this file.

Functions

template<class ArgIt>
static FunctionEnsureFunctionExists (Module &M, const char *Name, ArgIt ArgBegin, ArgIt ArgEnd, const Type *RetTy)
template<class ArgIt>
static CallInstReplaceCallWith (const char *NewFn, CallInst *CI, ArgIt ArgBegin, ArgIt ArgEnd, const Type *RetTy, Function *&FCache)
static ValueLowerBSWAP (Value *V, Instruction *IP)
static ValueLowerCTPOP (Value *V, Instruction *IP)
static ValueLowerCTLZ (Value *V, Instruction *IP)


Function Documentation

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

Definition at line 25 of file IntrinsicLowering.cpp.

References F, llvm::Module::getNamedFunction(), llvm::Module::getOrInsertFunction(), I, M, and RetTy.

Referenced by llvm::DefaultIntrinsicLowering::AddPrototypes().

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

LowerBSWAP - Emit the code to lower bswap of V before the specified instruction IP.

Definition at line 138 of file IntrinsicLowering.cpp.

References llvm::ConstantUInt::get(), llvm::ConstantInt::get(), llvm::Instruction::Shl, llvm::Type::UByteTy, llvm::Type::UIntTy, llvm::Type::ULongTy, and V.

Referenced by llvm::DefaultIntrinsicLowering::LowerIntrinsicCall().

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

LowerCTLZ - Emit the code to lower ctlz of V before the specified instruction IP.

Definition at line 266 of file IntrinsicLowering.cpp.

References llvm::BinaryOperator::createNot(), llvm::ConstantInt::get(), llvm::Type::getUnsignedVersion(), llvm::Type::isSigned(), LowerCTPOP(), llvm::Type::UByteTy, and V.

Referenced by llvm::DefaultIntrinsicLowering::LowerIntrinsicCall().

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

LowerCTPOP - Emit the code to lower ctpop of V before the specified instruction IP.

Definition at line 232 of file IntrinsicLowering.cpp.

References llvm::ConstantInt::get(), llvm::ConstantUInt::get(), llvm::ConstantExpr::getCast(), llvm::Value::getType(), llvm::Type::getUnsignedVersion(), llvm::Type::isSigned(), llvm::Type::UByteTy, llvm::Type::ULongTy, and V.

Referenced by LowerCTLZ(), and llvm::DefaultIntrinsicLowering::LowerIntrinsicCall().

template<class ArgIt>
static CallInst* ReplaceCallWith ( const char *  NewFn,
CallInst CI,
ArgIt  ArgBegin,
ArgIt  ArgEnd,
const Type RetTy,
Function *&  FCache 
) [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 41 of file IntrinsicLowering.cpp.

References llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::Module::getNamedFunction(), llvm::FunctionType::getNumParams(), llvm::Module::getOrInsertFunction(), llvm::FunctionType::getParamType(), llvm::GlobalValue::getParent(), llvm::BasicBlock::getParent(), llvm::Instruction::getParent(), llvm::FunctionType::getReturnType(), llvm::Value::getType(), I, M, Name, llvm::Value::replaceAllUsesWith(), RetTy, llvm::Value::setName(), llvm::Value::use_empty(), and V.

Referenced by llvm::DefaultIntrinsicLowering::LowerIntrinsicCall().