|
LLVM
4.0.0
|
#include <IntrinsicLowering.h>
Public Member Functions | |
| IntrinsicLowering (const DataLayout &DL) | |
| void | 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. More... | |
| void | LowerIntrinsicCall (CallInst *CI) |
| LowerIntrinsicCall - This method replaces a call with the LLVM function which should be used to implement the specified intrinsic function call. More... | |
Static Public Member Functions | |
| static bool | LowerToByteSwap (CallInst *CI) |
| LowerToByteSwap - Replace a call instruction into a call to bswap intrinsic. More... | |
Definition at line 26 of file IntrinsicLowering.h.
|
inlineexplicit |
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 Context, EnsureFPIntrinsicsExist(), EnsureFunctionExists(), F, llvm::Module::getContext(), llvm::Type::getInt32Ty(), llvm::Type::getInt8PtrTy(), llvm::DataLayout::getIntPtrType(), and llvm::Type::getVoidTy().
| 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, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), assert(), 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::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::Value::getType(), llvm::Type::getVoidTy(), llvm::Type::isVoidTy(), LowerBSWAP(), LowerCTLZ(), LowerCTPOP(), llvm::Intrinsic::not_intrinsic, prefetch, llvm::Value::replaceAllUsesWith(), ReplaceCallWith(), ReplaceFPIntrinsicWithCall(), llvm::report_fatal_error(), round(), llvm::Value::setName(), and llvm::Value::use_empty().
Referenced by llvm::Interpreter::visitCallSite().
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 593 of file IntrinsicLowering.cpp.
References llvm::CallInst::Create(), llvm::dyn_cast(), llvm::Instruction::eraseFromParent(), llvm::CallInst::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::CallInst::getNumArgOperands(), llvm::Value::getType(), llvm::Type::isIntegerTy(), and llvm::Value::replaceAllUsesWith().
Referenced by llvm::ARMTargetLowering::ExpandInlineAsm(), and llvm::X86TargetLowering::ExpandInlineAsm().
1.8.6