LLVM  7.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
llvm::IntrinsicLowering Class Reference

#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...
 

Detailed Description

Definition at line 26 of file IntrinsicLowering.h.

Constructor & Destructor Documentation

◆ IntrinsicLowering()

llvm::IntrinsicLowering::IntrinsicLowering ( const DataLayout DL)
inlineexplicit

Definition at line 32 of file IntrinsicLowering.h.

References AddPrototypes(), LowerIntrinsicCall(), and LowerToByteSwap().

Member Function Documentation

◆ AddPrototypes()

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, EnsureFPIntrinsicsExist(), EnsureFunctionExists(), F(), llvm::Module::getContext(), llvm::Type::getInt32Ty(), llvm::Type::getInt8PtrTy(), llvm::DataLayout::getIntPtrType(), llvm::Type::getVoidTy(), and llvm::log2().

Referenced by IntrinsicLowering().

◆ LowerIntrinsicCall()

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::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(), Callee, Context, llvm::IRBuilder< T, Inserter >::CreateAnd(), llvm::IRBuilder< T, Inserter >::CreateIntCast(), llvm::IRBuilder< T, Inserter >::CreateNot(), llvm::IRBuilder< T, Inserter >::CreateSub(), llvm::Instruction::eraseFromParent(), llvm::errs(), llvm::ConstantInt::get(), llvm::ConstantPointerNull::get(), llvm::UndefValue::get(), llvm::CallBase< InstTy >::getArgOperand(), llvm::CallBase< InstTy >::getCalledFunction(), llvm::Value::getContext(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::DataLayout::getIntPtrType(), llvm::Function::getIntrinsicID(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::CallBase< InstTy >::getOperand(), llvm::Value::getType(), llvm::Type::getVoidTy(), llvm::Type::isVoidTy(), llvm::log2(), LowerBSWAP(), LowerCTLZ(), LowerCTPOP(), llvm::Intrinsic::not_intrinsic, prefetch, llvm::Value::replaceAllUsesWith(), ReplaceCallWith(), ReplaceFPIntrinsicWithCall(), llvm::report_fatal_error(), round(), llvm::Value::setName(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Size, and llvm::Value::use_empty().

Referenced by IntrinsicLowering(), and llvm::Interpreter::visitCallSite().

◆ LowerToByteSwap()

bool IntrinsicLowering::LowerToByteSwap ( CallInst CI)
static

The documentation for this class was generated from the following files: