LLVM API Documentation
#include "Mips16HardFloat.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <string>
Go to the source code of this file.
#define DEBUG_TYPE "mips16-hard-float" |
Definition at line 22 of file Mips16HardFloat.cpp.
typedef Type::TypeID TypeID |
Definition at line 98 of file Mips16HardFloat.cpp.
enum FPParamVariant |
Definition at line 91 of file Mips16HardFloat.cpp.
enum FPReturnVariant |
Definition at line 58 of file Mips16HardFloat.cpp.
static void assureFPCallStub | ( | Function & | F, |
Module * | M, | ||
const MipsSubtarget & | Subtarget | ||
) | [static] |
Definition at line 249 of file Mips16HardFloat.cpp.
References llvm::Function::addFnAttr(), CDRet, CFRet, DRet, FRet, llvm::Module::getContext(), llvm::Module::getFunction(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::MipsSubtarget::getRelocationModel(), llvm::Function::getReturnType(), llvm::GlobalValue::isDeclaration(), llvm::MipsSubtarget::isLittle(), llvm::Attribute::Naked, Name, NoFPRet, llvm::Attribute::NoInline, llvm::Attribute::NoUnwind, llvm::Reloc::PIC_, llvm::GlobalObject::setSection(), swapFPIntParams(), whichFPParamVariantNeeded(), and whichFPReturnVariant().
Referenced by fixupFPReturnAndCall().
static void createFPFnStub | ( | Function * | F, |
Module * | M, | ||
FPParamVariant | PV, | ||
const MipsSubtarget & | Subtarget | ||
) | [static] |
Definition at line 441 of file Mips16HardFloat.cpp.
References llvm::Function::addFnAttr(), llvm::Function::getContext(), llvm::Module::getContext(), llvm::Function::getFunctionType(), llvm::Value::getName(), llvm::MipsSubtarget::getRelocationModel(), llvm::MipsSubtarget::isLittle(), llvm::Attribute::Naked, Name, llvm::Attribute::NoInline, llvm::Attribute::NoUnwind, llvm::Reloc::PIC_, llvm::GlobalObject::setSection(), and swapFPIntParams().
Referenced by llvm::Mips16HardFloat::runOnModule().
static bool fixupFPReturnAndCall | ( | Function & | F, |
Module * | M, | ||
const MipsSubtarget & | Subtarget | ||
) | [static] |
Definition at line 366 of file Mips16HardFloat.cpp.
References llvm::ARM_PROC::A, llvm::AttributeSet::addAttribute(), llvm::Function::addFnAttr(), assureFPCallStub(), llvm::BasicBlock::begin(), llvm::Function::begin(), llvm::dyn_cast(), llvm::BasicBlock::end(), llvm::Function::end(), llvm::Module::getContext(), llvm::SequentialType::getElementType(), llvm::Module::getOrInsertFunction(), llvm::MipsSubtarget::getRelocationModel(), llvm::Value::getType(), I, isIntrinsicInline(), Name, needsFPHelperFromSig(), needsFPReturnHelper(), NoFPRet, llvm::Reloc::PIC_, T, and whichFPReturnVariant().
Referenced by llvm::Mips16HardFloat::runOnModule().
static void inlineAsmOut | ( | LLVMContext & | C, |
StringRef | AsmString, | ||
BasicBlock * | BB | ||
) | [static] |
Definition at line 25 of file Mips16HardFloat.cpp.
References llvm::InlineAsm::AD_ATT, llvm::InlineAsm::get(), and llvm::FunctionType::get().
static bool isIntrinsicInline | ( | Function * | F | ) | [static] |
Definition at line 357 of file Mips16HardFloat.cpp.
References llvm::sys::path::begin(), llvm::sys::path::end(), and llvm::Value::getName().
Referenced by fixupFPReturnAndCall().
static bool needsFPHelperFromSig | ( | Function & | F | ) | [static] |
Definition at line 177 of file Mips16HardFloat.cpp.
References needsFPReturnHelper(), and needsFPStubFromParams().
Referenced by fixupFPReturnAndCall().
static bool needsFPReturnHelper | ( | Function & | F | ) | [static] |
Definition at line 167 of file Mips16HardFloat.cpp.
References llvm::Function::getReturnType(), NoFPRet, and whichFPReturnVariant().
Referenced by fixupFPReturnAndCall(), and needsFPHelperFromSig().
static bool needsFPReturnHelper | ( | const FunctionType & | FT | ) | [static] |
Definition at line 172 of file Mips16HardFloat.cpp.
References llvm::FunctionType::getReturnType(), NoFPRet, and whichFPReturnVariant().
static bool needsFPStubFromParams | ( | Function & | F | ) | [static] |
Definition at line 153 of file Mips16HardFloat.cpp.
References llvm::Function::arg_size(), DoubleTyID, FloatTyID, llvm::Function::getFunctionType(), llvm::FunctionType::getParamType(), and llvm::Type::getTypeID().
Referenced by needsFPHelperFromSig().
static void removeUseSoftFloat | ( | Function & | F | ) | [static] |
Definition at line 482 of file Mips16HardFloat.cpp.
References llvm::ARM_PROC::A, llvm::AttributeSet::addAttribute(), llvm::Function::addAttributes(), DEBUG, llvm::errs(), llvm::Function::getContext(), llvm::Function::hasFnAttribute(), and llvm::Function::removeAttributes().
Referenced by llvm::Mips16HardFloat::runOnModule().
static void swapFPIntParams | ( | FPParamVariant | PV, |
Module * | M, | ||
InlineAsmHelper & | IAH, | ||
bool | LE, | ||
bool | ToFP | ||
) | [static] |
Definition at line 187 of file Mips16HardFloat.cpp.
References DDSig, DFSig, DSig, FDSig, FFSig, FSig, llvm::AArch64CC::MI, and NoSig.
Referenced by assureFPCallStub(), and createFPFnStub().
static FPParamVariant whichFPParamVariantNeeded | ( | Function & | F | ) | [static] |
Definition at line 102 of file Mips16HardFloat.cpp.
References llvm::Function::arg_size(), DDSig, DFSig, DSig, FDSig, FFSig, FSig, llvm::Function::getFunctionType(), llvm::FunctionType::getParamType(), llvm::Type::getTypeID(), llvm_unreachable, and NoSig.
Referenced by assureFPCallStub(), and llvm::Mips16HardFloat::runOnModule().
static FPReturnVariant whichFPReturnVariant | ( | Type * | T | ) | [static] |
Definition at line 65 of file Mips16HardFloat.cpp.
References CDRet, CFRet, DoubleTyID, DRet, FloatTyID, FRet, llvm::Type::getContainedType(), llvm::Type::getStructNumElements(), llvm::Type::getTypeID(), llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), and NoFPRet.
Referenced by assureFPCallStub(), fixupFPReturnAndCall(), and needsFPReturnHelper().
Definition at line 100 of file Mips16HardFloat.cpp.
Referenced by needsFPStubFromParams(), and whichFPReturnVariant().
Definition at line 99 of file Mips16HardFloat.cpp.
Referenced by needsFPStubFromParams(), and whichFPReturnVariant().
const char* IntrinsicInline[] [static] |
{"fabs", "fabsf", "llvm.ceil.f32", "llvm.ceil.f64", "llvm.copysign.f32", "llvm.copysign.f64", "llvm.cos.f32", "llvm.cos.f64", "llvm.exp.f32", "llvm.exp.f64", "llvm.exp2.f32", "llvm.exp2.f64", "llvm.fabs.f32", "llvm.fabs.f64", "llvm.floor.f32", "llvm.floor.f64", "llvm.fma.f32", "llvm.fma.f64", "llvm.log.f32", "llvm.log.f64", "llvm.log10.f32", "llvm.log10.f64", "llvm.nearbyint.f32", "llvm.nearbyint.f64", "llvm.pow.f32", "llvm.pow.f64", "llvm.powi.f32", "llvm.powi.f64", "llvm.rint.f32", "llvm.rint.f64", "llvm.round.f32", "llvm.round.f64", "llvm.sin.f32", "llvm.sin.f64", "llvm.sqrt.f32", "llvm.sqrt.f64", "llvm.trunc.f32", "llvm.trunc.f64", }
Definition at line 334 of file Mips16HardFloat.cpp.