LLVM
8.0.1
|
#include "llvm/CodeGen/IntrinsicLowering.h"
Public Member Functions | |
IntrinsicLowering (const DataLayout &DL) | |
void | AddPrototypes (Module &M) |
Add all of the prototypes that might be needed by an intrinsic lowering implementation to be inserted into the module specified. More... | |
void | LowerIntrinsicCall (CallInst *CI) |
Replace a call to the specified intrinsic function. More... | |
Static Public Member Functions | |
static bool | LowerToByteSwap (CallInst *CI) |
Try to replace a call instruction with a call to a bswap intrinsic. More... | |
Definition at line 26 of file IntrinsicLowering.h.
|
inlineexplicit |
Definition at line 32 of file IntrinsicLowering.h.
References AddPrototypes(), LowerIntrinsicCall(), and LowerToByteSwap().
void IntrinsicLowering::AddPrototypes | ( | Module & | M | ) |
Add 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 Context, llvm::Intrinsic::cos, EnsureFPIntrinsicsExist(), EnsureFunctionExists(), llvm::Intrinsic::exp, llvm::Intrinsic::exp2, F(), llvm::Module::getContext(), llvm::Type::getInt32Ty(), llvm::Type::getInt8PtrTy(), llvm::DataLayout::getIntPtrType(), llvm::Type::getVoidTy(), llvm::Intrinsic::log, llvm::Intrinsic::log10, llvm::Intrinsic::log2, llvm::Intrinsic::longjmp, llvm::Intrinsic::memcpy, llvm::Intrinsic::memmove, llvm::Intrinsic::memset, llvm::Intrinsic::pow, llvm::Intrinsic::setjmp, llvm::Intrinsic::siglongjmp, llvm::Intrinsic::sin, and llvm::Intrinsic::sqrt.
Referenced by IntrinsicLowering().
void IntrinsicLowering::LowerIntrinsicCall | ( | CallInst * | CI | ) |
Replace a call to the specified intrinsic function.
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 337 of file IntrinsicLowering.cpp.
References llvm::Intrinsic::addressofreturnaddress, llvm::Intrinsic::annotation, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), assert(), llvm::Intrinsic::assume, llvm::Intrinsic::bswap, Callee, llvm::Intrinsic::ceil, Context, llvm::Intrinsic::copysign, llvm::Intrinsic::cos, llvm::IRBuilder< T, Inserter >::CreateAnd(), llvm::IRBuilder< T, Inserter >::CreateIntCast(), llvm::IRBuilder< T, Inserter >::CreateNot(), llvm::IRBuilder< T, Inserter >::CreateSub(), llvm::Intrinsic::ctlz, llvm::Intrinsic::ctpop, llvm::Intrinsic::cttz, llvm::Intrinsic::dbg_declare, llvm::Intrinsic::dbg_label, llvm::Intrinsic::eh_typeid_for, llvm::Instruction::eraseFromParent(), llvm::errs(), llvm::Intrinsic::exp, llvm::Intrinsic::exp2, llvm::Intrinsic::expect, llvm::Intrinsic::floor, llvm::Intrinsic::flt_rounds, llvm::Intrinsic::frameaddress, llvm::ConstantInt::get(), llvm::ConstantPointerNull::get(), llvm::UndefValue::get(), llvm::Intrinsic::get_dynamic_area_offset, llvm::CallBase::getArgOperand(), llvm::CallBase::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::Value::getType(), llvm::Type::getVoidTy(), llvm::Intrinsic::invariant_end, llvm::Intrinsic::invariant_start, llvm::Type::isVoidTy(), llvm::Intrinsic::lifetime_end, llvm::Intrinsic::lifetime_start, llvm::Intrinsic::log, llvm::Intrinsic::log10, llvm::Intrinsic::log2, llvm::Intrinsic::longjmp, LowerBSWAP(), LowerCTLZ(), LowerCTPOP(), llvm::Intrinsic::memcpy, llvm::Intrinsic::memmove, llvm::Intrinsic::memset, llvm::Intrinsic::not_intrinsic, llvm::Intrinsic::pcmarker, llvm::Intrinsic::pow, llvm::Intrinsic::prefetch, llvm::Intrinsic::ptr_annotation, llvm::Intrinsic::readcyclecounter, llvm::Value::replaceAllUsesWith(), ReplaceCallWith(), ReplaceFPIntrinsicWithCall(), llvm::report_fatal_error(), llvm::Intrinsic::returnaddress, llvm::Intrinsic::round, llvm::Intrinsic::setjmp, llvm::Value::setName(), llvm::Intrinsic::siglongjmp, llvm::Intrinsic::sigsetjmp, llvm::Intrinsic::sin, Size, llvm::Intrinsic::sqrt, llvm::Intrinsic::stackrestore, llvm::Intrinsic::stacksave, llvm::Intrinsic::trunc, llvm::Value::use_empty(), and llvm::Intrinsic::var_annotation.
Referenced by IntrinsicLowering(), and llvm::Interpreter::visitCallSite().
Try to replace a call instruction with a call to a bswap intrinsic.
Return false if the call is not a simple integer bswap.
Definition at line 591 of file IntrinsicLowering.cpp.
References llvm::Intrinsic::bswap, llvm::CallInst::Create(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::CallBase::getNumArgOperands(), llvm::Value::getType(), llvm::Type::isIntegerTy(), and llvm::Value::replaceAllUsesWith().
Referenced by llvm::ARMTargetLowering::ExpandInlineAsm(), llvm::X86TargetLowering::ExpandInlineAsm(), and IntrinsicLowering().