LLVM API Documentation
#include <IntrinsicLowering.h>
Public Member Functions | |
IntrinsicLowering (const DataLayout &DL) | |
void | AddPrototypes (Module &M) |
void | LowerIntrinsicCall (CallInst *CI) |
Static Public Member Functions | |
static bool | LowerToByteSwap (CallInst *CI) |
Definition at line 26 of file IntrinsicLowering.h.
llvm::IntrinsicLowering::IntrinsicLowering | ( | const DataLayout & | DL | ) | [inline, explicit] |
Definition at line 32 of file IntrinsicLowering.h.
void IntrinsicLowering::AddPrototypes | ( | Module & | M | ) |
AddPrototypes - This method, if called, causes all of the prototypes that might be needed by an intrinsic lowering implementation to be inserted into the module specified.
Definition at line 95 of file IntrinsicLowering.cpp.
References llvm::Module::begin(), llvm::LibFunc::cos, llvm::Module::end(), EnsureFPIntrinsicsExist(), EnsureFunctionExists(), llvm::LibFunc::exp, llvm::LibFunc::exp2, llvm::Module::getContext(), llvm::Type::getInt32Ty(), llvm::Type::getInt8PtrTy(), llvm::DataLayout::getIntPtrType(), llvm::Module::getOrInsertFunction(), llvm::Type::getVoidTy(), I, llvm::LibFunc::log, llvm::LibFunc::log10, llvm::LibFunc::log2, llvm::LibFunc::memcpy, llvm::LibFunc::memmove, llvm::LibFunc::memset, llvm::LibFunc::pow, llvm::LibFunc::sin, and llvm::LibFunc::sqrt.
void IntrinsicLowering::LowerIntrinsicCall | ( | CallInst * | CI | ) |
LowerIntrinsicCall - This method replaces a call with the LLVM function which should be used to implement the specified intrinsic function call. If an intrinsic function must be implemented by the code generator (such as va_start), this function should print a message and abort.
Otherwise, if an intrinsic function call can be lowered, the code to implement it (often a call to a non-intrinsic function) is inserted _after_ the call instruction and the call is deleted. The caller must be capable of handling this kind of change.
Definition at line 340 of file IntrinsicLowering.cpp.
References llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), llvm::LibFunc::ceil, llvm::LibFunc::copysign, llvm::LibFunc::cos, llvm::IRBuilder< preserveNames, T, Inserter >::CreateAnd(), llvm::Instruction::eraseFromParent(), llvm::errs(), llvm::LibFunc::exp, llvm::LibFunc::exp2, llvm::LibFunc::floor, llvm::ConstantInt::get(), llvm::ConstantPointerNull::get(), llvm::UndefValue::get(), llvm::CallInst::getArgOperand(), llvm::CallInst::getCalledFunction(), llvm::Value::getContext(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::DataLayout::getIntPtrType(), llvm::Function::getIntrinsicID(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::Value::getType(), llvm::Type::getVoidTy(), llvm::Type::isVoidTy(), llvm::LibFunc::log, llvm::LibFunc::log10, llvm::LibFunc::log2, LowerBSWAP(), LowerCTLZ(), LowerCTPOP(), llvm::LibFunc::memcpy, llvm::LibFunc::memmove, llvm::LibFunc::memset, llvm::Intrinsic::not_intrinsic, llvm::LibFunc::pow, llvm::Value::replaceAllUsesWith(), ReplaceCallWith(), ReplaceFPIntrinsicWithCall(), llvm::report_fatal_error(), llvm::LibFunc::round, llvm::Value::setName(), llvm::LibFunc::sin, llvm::LibFunc::sqrt, llvm::LibFunc::trunc, and llvm::Value::use_empty().
Referenced by llvm::Interpreter::visitCallSite().
bool IntrinsicLowering::LowerToByteSwap | ( | CallInst * | CI | ) | [static] |
LowerToByteSwap - Replace a call instruction into a call to bswap intrinsic. Return false if it has determined the call is not a simple integer bswap.
Definition at line 580 of file IntrinsicLowering.cpp.
References llvm::CallInst::Create(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::CallInst::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Value::getName(), llvm::CallInst::getNumArgOperands(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::Value::getType(), llvm::tgtok::Int, llvm::Type::isIntegerTy(), and llvm::Value::replaceAllUsesWith().
Referenced by llvm::ARMTargetLowering::ExpandInlineAsm().