LLVM API Documentation
#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"
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) |
| static void EnsureFPIntrinsicsExist | ( | Module & | M, | |
| Function * | Fn, | |||
| const char * | FName, | |||
| const char * | DName, | |||
| const char * | LDName | |||
| ) | [static] |
Definition at line 36 of file IntrinsicLowering.cpp.
References llvm::Function::arg_begin(), llvm::Function::arg_end(), EnsureFunctionExists(), and llvm::Module::getContext().
Referenced by llvm::IntrinsicLowering::AddPrototypes().
| static void EnsureFunctionExists | ( | Module & | M, | |
| const char * | Name, | |||
| ArgIt | ArgBegin, | |||
| ArgIt | ArgEnd, | |||
| const Type * | RetTy | |||
| ) | [inline, static] |
Definition at line 26 of file IntrinsicLowering.cpp.
References llvm::Module::getOrInsertFunction().
Referenced by llvm::IntrinsicLowering::AddPrototypes(), and EnsureFPIntrinsicsExist().
| static Value* LowerBSWAP | ( | LLVMContext & | Context, | |
| Value * | V, | |||
| Instruction * | IP | |||
| ) | [static] |
LowerBSWAP - Emit the code to lower bswap of V before the specified instruction IP.
Definition at line 156 of file IntrinsicLowering.cpp.
References Builder, llvm::IRBuilder< preserveNames, T >::CreateAnd(), llvm::IRBuilder< preserveNames, T >::CreateLShr(), llvm::IRBuilder< preserveNames, T >::CreateOr(), llvm::IRBuilder< preserveNames, T >::CreateShl(), llvm::ConstantInt::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::Instruction::getParent(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isInteger(), and llvm_unreachable.
Referenced by llvm::IntrinsicLowering::LowerIntrinsicCall().
| static Value* LowerCTLZ | ( | LLVMContext & | Context, | |
| Value * | V, | |||
| Instruction * | IP | |||
| ) | [static] |
LowerCTLZ - Emit the code to lower ctlz of V before the specified instruction IP.
Definition at line 292 of file IntrinsicLowering.cpp.
References Builder, llvm::IRBuilder< preserveNames, T >::CreateLShr(), llvm::IRBuilder< preserveNames, T >::CreateNot(), llvm::IRBuilder< preserveNames, T >::CreateOr(), llvm::ConstantInt::get(), llvm::Instruction::getParent(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and LowerCTPOP().
Referenced by llvm::IntrinsicLowering::LowerIntrinsicCall().
| static Value* LowerCTPOP | ( | LLVMContext & | Context, | |
| Value * | V, | |||
| Instruction * | IP | |||
| ) | [static] |
LowerCTPOP - Emit the code to lower ctpop of V before the specified instruction IP.
Definition at line 252 of file IntrinsicLowering.cpp.
References Builder, llvm::IRBuilder< preserveNames, T >::CreateAdd(), llvm::IRBuilder< preserveNames, T >::CreateAnd(), llvm::IRBuilder< preserveNames, T >::CreateLShr(), llvm::ConstantInt::get(), llvm::Instruction::getParent(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isInteger(), LHS, and RHS.
Referenced by LowerCTLZ(), llvm::IntrinsicLowering::LowerIntrinsicCall(), and llvm::SPUTargetLowering::LowerOperation().
| 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] |
Definition at line 307 of file IntrinsicLowering.cpp.
References llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::Type::FP128TyID, llvm::Value::getContext(), llvm::Type::getDoubleTy(), llvm::Type::getFloatTy(), llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm_unreachable, llvm::User::op_begin(), llvm::User::op_end(), llvm::Type::PPC_FP128TyID, ReplaceCallWith(), and llvm::Type::X86_FP80TyID.
Referenced by llvm::IntrinsicLowering::LowerIntrinsicCall().