LLVM API Documentation
#include "llvm/Constants.h"#include "llvm/DerivedTypes.h"#include "llvm/Module.h"#include "llvm/Instructions.h"#include "llvm/Type.h"#include "llvm/CodeGen/IntrinsicLowering.h"#include "llvm/Support/Streams.h"#include "llvm/Target/TargetData.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/STLExtras.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, Module::iterator I, 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, Constant *&FCache) |
| static Value * | LowerBSWAP (Value *V, Instruction *IP) |
| static Value * | LowerCTPOP (Value *V, Instruction *IP) |
| static Value * | LowerCTLZ (Value *V, Instruction *IP) |
| static Instruction * | LowerPartSelect (CallInst *CI) |
| Lowering of llvm.part.select intrinsic. | |
| static Instruction * | LowerPartSet (CallInst *CI) |
| Lowering of llvm.bit.part.set intrinsic. | |
| static void | ReplaceFPIntrinsicWithCall (CallInst *CI, Constant *FCache, Constant *DCache, Constant *LDCache, const char *Fname, const char *Dname, const char *LDname) |
| static void EnsureFPIntrinsicsExist | ( | Module & | M, | |
| Module::iterator | I, | |||
| const char * | FName, | |||
| const char * | DName, | |||
| const char * | LDName | |||
| ) | [static] |
Definition at line 37 of file IntrinsicLowering.cpp.
References EnsureFunctionExists().
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 27 of file IntrinsicLowering.cpp.
References llvm::Module::getOrInsertFunction().
Referenced by llvm::IntrinsicLowering::AddPrototypes(), and EnsureFPIntrinsicsExist().
| 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 151 of file IntrinsicLowering.cpp.
References llvm::ConstantInt::get(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::Int32Ty, llvm::Type::Int64Ty, and llvm::Type::isInteger().
Referenced by llvm::IntrinsicLowering::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 275 of file IntrinsicLowering.cpp.
References llvm::BinaryOperator::CreateNot(), llvm::ConstantInt::get(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), and LowerCTPOP().
Referenced by llvm::IntrinsicLowering::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 237 of file IntrinsicLowering.cpp.
References llvm::ConstantInt::get(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::isInteger(), LHS, and RHS.
Referenced by LowerCTLZ(), llvm::IntrinsicLowering::LowerIntrinsicCall(), and llvm::SPUTargetLowering::LowerOperation().
| static Instruction* LowerPartSelect | ( | CallInst * | CI | ) | [static] |
Lowering of llvm.part.select intrinsic.
Convert the llvm.part.select.iX.iY intrinsic. This intrinsic takes three integer arguments. The first argument is the Value from which the bits will be selected. It may be of any bit width. The second and third arguments specify a range of bits to select with the second argument specifying the low bit and the third argument specifying the high bit. Both must be type i32. The result is the corresponding selected bits from the Value in the same width as the Value (first argument). If the low bit index is higher than the high bit index then the inverse selection is done and the bits are returned in inverse order.
Definition at line 298 of file IntrinsicLowering.cpp.
References llvm::PHINode::addIncoming(), llvm::Function::arg_begin(), llvm::array_endof(), llvm::CallInst::Create(), llvm::ReturnInst::Create(), llvm::PHINode::Create(), llvm::BranchInst::Create(), llvm::BasicBlock::Create(), llvm::CastInst::CreateIntegerCast(), llvm::BinaryOperator::CreateNot(), CurBB, F, llvm::ConstantInt::get(), llvm::ConstantInt::getAllOnesValue(), llvm::CallInst::getCalledFunction(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::FunctionType::getNumParams(), llvm::User::getOperand(), llvm::Module::getOrInsertFunction(), llvm::FunctionType::getParamType(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::FunctionType::getReturnType(), llvm::Value::getType(), llvm::SPISD::Hi, llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_ULT, llvm::Function::isDeclaration(), llvm::Type::isInteger(), llvm::SPISD::Lo, M, Name, llvm::PHINode::reserveOperandSpace(), llvm::GlobalValue::setLinkage(), llvm::Value::setName(), Val, and llvm::GlobalValue::WeakLinkage.
Referenced by llvm::IntrinsicLowering::LowerIntrinsicCall().
| static Instruction* LowerPartSet | ( | CallInst * | CI | ) | [static] |
Lowering of llvm.bit.part.set intrinsic.
Convert the llvm.part.set.iX.iY.iZ intrinsic. This intrinsic takes four integer arguments (iAny Value, iAny Replacement, i32 Low, i32 High) The first two arguments can be any bit width. The result is the same width as Value. The operation replaces bits between Low and High with the value in Replacement. If Replacement is not the same width, it is truncated or zero extended as appropriate to fit the bits being replaced. If Low is greater than High then the inverse set of bits are replaced.
Definition at line 471 of file IntrinsicLowering.cpp.
References llvm::PHINode::addIncoming(), llvm::Function::arg_begin(), llvm::array_endof(), llvm::CallInst::Create(), llvm::ReturnInst::Create(), llvm::PHINode::Create(), llvm::BranchInst::Create(), llvm::SelectInst::Create(), llvm::BasicBlock::Create(), llvm::CastInst::CreateIntegerCast(), llvm::BinaryOperator::CreateNot(), F, llvm::ConstantInt::get(), llvm::ConstantInt::getAllOnesValue(), llvm::IntegerType::getBitWidth(), llvm::CallInst::getCalledFunction(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::FunctionType::getNumParams(), llvm::User::getOperand(), llvm::Module::getOrInsertFunction(), llvm::FunctionType::getParamType(), llvm::GlobalValue::getParent(), llvm::FunctionType::getReturnType(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::SPISD::Hi, llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_ULT, llvm::Type::Int32Ty, llvm::Function::isDeclaration(), llvm::Type::isInteger(), llvm::SPISD::Lo, M, Name, llvm::PHINode::reserveOperandSpace(), llvm::GlobalValue::setLinkage(), llvm::Value::setName(), Val, and llvm::GlobalValue::WeakLinkage.
Referenced by llvm::IntrinsicLowering::LowerIntrinsicCall().
| static CallInst* ReplaceCallWith | ( | const char * | NewFn, | |
| CallInst * | CI, | |||
| ArgIt | ArgBegin, | |||
| ArgIt | ArgEnd, | |||
| const Type * | RetTy, | |||
| Constant *& | FCache | |||
| ) | [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 61 of file IntrinsicLowering.cpp.
References llvm::SmallVectorImpl< T >::begin(), llvm::SmallVectorImpl< T >::end(), llvm::Value::getName(), llvm::Module::getOrInsertFunction(), llvm::GlobalValue::getParent(), llvm::BasicBlock::getParent(), llvm::Instruction::getParent(), M, llvm::Value::replaceAllUsesWith(), and llvm::Value::use_empty().
Referenced by llvm::IntrinsicLowering::LowerIntrinsicCall(), and ReplaceFPIntrinsicWithCall().
| static void ReplaceFPIntrinsicWithCall | ( | CallInst * | CI, | |
| Constant * | FCache, | |||
| Constant * | DCache, | |||
| Constant * | LDCache, | |||
| const char * | Fname, | |||
| const char * | Dname, | |||
| const char * | LDname | |||
| ) | [static] |
Definition at line 631 of file IntrinsicLowering.cpp.
References llvm::Type::DoubleTy, llvm::Type::DoubleTyID, llvm::Type::FloatTy, llvm::Type::FloatTyID, llvm::Type::FP128TyID, llvm::User::getOperand(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::User::op_begin(), llvm::User::op_end(), llvm::Type::PPC_FP128TyID, ReplaceCallWith(), and llvm::Type::X86_FP80TyID.
Referenced by llvm::IntrinsicLowering::LowerIntrinsicCall().