15 #define DEBUG_TYPE "jit"
40 STATISTIC(NumInitBytes,
"Number of bytes of global vars initialized");
41 STATISTIC(NumGlobals ,
"Number of global vars initialized");
44 void ObjectCache::anchor() {}
45 void ObjectBuffer::anchor() {}
46 void ObjectBufferStream::anchor() {}
50 std::string *ErrorStr,
56 std::string *ErrorStr,
61 std::string *ErrorStr) = 0;
65 LazyFunctionCreator(0) {
66 CompilingLazily =
false;
67 GVCompilationDisabled =
false;
68 SymbolSearchingDisabled =
false;
70 assert(M &&
"Module is null?");
75 for (
unsigned i = 0, e =
Modules.size(); i != e; ++i)
92 void *RawMemory = ::operator
new(
96 new(RawMemory) GVMemoryBlock(GV);
97 return static_cast<char*
>(RawMemory) +
sizeof(GVMemoryBlock);
100 virtual void deleted() {
104 this->~GVMemoryBlock();
105 ::operator
delete(
this);
128 for (
unsigned i = 0, e =
Modules.size(); i != e; ++i) {
143 if (I == GlobalAddressMap.
end())
147 GlobalAddressMap.
erase(I);
150 GlobalAddressReverseMap.erase(OldVal);
158 <<
"\' to [" << Addr <<
"]\n";);
160 assert((CurVal == 0 || Addr == 0) &&
"GlobalMapping already established!");
167 assert((V == 0 || GV == 0) &&
"GlobalMapping already established!");
199 void *&CurVal = Map[GV];
200 void *OldVal = CurVal;
210 assert((V == 0 || GV == 0) &&
"GlobalMapping already established!");
233 I->second,
I->first));
236 std::map<void *, AssertingVH<const GlobalValue> >::iterator
I =
244 std::vector<char*> Values;
246 ArgvArray() : Array(NULL) {}
247 ~ArgvArray() { clear(); }
251 for (
size_t I = 0, E = Values.size();
I != E; ++
I) {
259 const std::vector<std::string> &InputArgv);
263 const std::vector<std::string> &InputArgv) {
266 Array =
new char[(InputArgv.size()+1)*PtrSize];
268 DEBUG(
dbgs() <<
"JIT: ARGV = " << (
void*)Array <<
"\n");
271 for (
unsigned i = 0; i != InputArgv.size(); ++i) {
272 unsigned Size = InputArgv[i].size()+1;
273 char *Dest =
new char[Size];
274 Values.push_back(Dest);
275 DEBUG(
dbgs() <<
"JIT: ARGV[" << i <<
"] = " << (
void*)Dest <<
"\n");
277 std::copy(InputArgv[i].
begin(), InputArgv[i].
end(), Dest);
294 const char *
Name = isDtors ?
"llvm.global_dtors" :
"llvm.global_ctors";
308 for (
unsigned i = 0, e = InitList->
getNumOperands(); i != e; ++i) {
310 if (CS == 0)
continue;
322 if (
Function *
F = dyn_cast<Function>(FP))
333 for (
unsigned i = 0, e =
Modules.size(); i != e; ++i)
341 for (
unsigned i = 0; i < PtrSize; ++i)
342 if (*(i + (uint8_t*)Loc))
349 const std::vector<std::string> &argv,
350 const char *
const * envp) {
351 std::vector<GenericValue> GVArgs;
376 GVArgs.push_back(GVArgc);
381 "argv[0] was null after CreateArgv");
383 std::vector<std::string> EnvVars;
384 for (
unsigned i = 0; envp[i]; ++i)
385 EnvVars.push_back(envp[i]);
396 bool ForceInterpreter,
397 std::string *ErrorStr,
401 .setEngineKind(ForceInterpreter
404 .setErrorStr(ErrorStr)
405 .setOptLevel(OptLevel)
406 .setAllocateGVsWithCode(GVsWithCode);
415 std::string *ErrorStr,
423 *ErrorStr =
"JIT has not been linked in.";
440 if (!TM || (ErrorStr && ErrorStr->length() > 0))
return 0;
453 assert(!(JMM && MCJMM));
463 *ErrorStr =
"Cannot create an interpreter with a memory manager.";
468 if (MCJMM && ! UseMCJIT) {
471 "Cannot create a legacy JIT with a runtime dyld memory "
481 errs() <<
"WARNING: This target JIT is not designed for the host"
482 <<
" you are running. If bad things happen, please choose"
483 <<
" a different -march switch.\n";
489 AllocateGVsWithCode, TheTM.
take());
494 AllocateGVsWithCode, TheTM.
take());
505 *ErrorStr =
"Interpreter has not been linked in.";
512 *ErrorStr =
"JIT has not been linked in.";
519 if (
Function *
F = const_cast<Function*>(dyn_cast<Function>(GV)))
528 const_cast<GlobalVariable *>(dyn_cast<GlobalVariable>(GV)))
540 if (isa<UndefValue>(C)) {
556 unsigned int elemNum = STy->getNumElements();
558 for (
unsigned int i = 0; i < elemNum; ++i) {
559 Type *ElemTy = STy->getElementType(i);
577 if (ElemTy->isIntegerTy())
578 for (
unsigned int i = 0; i < elemNum; ++i)
580 APInt(ElemTy->getPrimitiveSizeInBits(), 0);
587 if (
const ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
589 switch (CE->getOpcode()) {
590 case Instruction::GetElementPtr: {
594 cast<GEPOperator>(CE)->accumulateConstantOffset(*TD, Offset);
597 Result =
PTOGV(tmp + Offset.getSExtValue());
600 case Instruction::Trunc: {
602 uint32_t BitWidth = cast<IntegerType>(CE->getType())->
getBitWidth();
606 case Instruction::ZExt: {
608 uint32_t BitWidth = cast<IntegerType>(CE->getType())->
getBitWidth();
612 case Instruction::SExt: {
614 uint32_t BitWidth = cast<IntegerType>(CE->getType())->
getBitWidth();
618 case Instruction::FPTrunc: {
624 case Instruction::FPExt:{
630 case Instruction::UIToFP: {
632 if (CE->getType()->isFloatTy())
634 else if (CE->getType()->isDoubleTy())
636 else if (CE->getType()->isX86_FP80Ty()) {
645 case Instruction::SIToFP: {
647 if (CE->getType()->isFloatTy())
649 else if (CE->getType()->isDoubleTy())
651 else if (CE->getType()->isX86_FP80Ty()) {
660 case Instruction::FPToUI:
661 case Instruction::FPToSI: {
663 uint32_t BitWidth = cast<IntegerType>(CE->getType())->
getBitWidth();
673 CE->getOpcode()==Instruction::FPToSI,
679 case Instruction::PtrToInt: {
682 assert(PtrWidth <= 64 &&
"Bad pointer width");
688 case Instruction::IntToPtr: {
696 case Instruction::BitCast: {
698 Type* DestTy = CE->getType();
709 assert(DestTy->
isIntegerTy(32) &&
"Invalid bitcast");
713 assert(DestTy->
isIntegerTy(64) &&
"Invalid bitcast");
717 assert(DestTy->
isPointerTy() &&
"Invalid bitcast");
722 case Instruction::Add:
723 case Instruction::FAdd:
724 case Instruction::Sub:
725 case Instruction::FSub:
726 case Instruction::Mul:
727 case Instruction::FMul:
728 case Instruction::UDiv:
729 case Instruction::SDiv:
730 case Instruction::URem:
731 case Instruction::SRem:
738 switch (CE->getOperand(0)->getType()->getTypeID()) {
741 switch (CE->getOpcode()) {
743 case Instruction::Add: GV.IntVal = LHS.
IntVal + RHS.
IntVal;
break;
744 case Instruction::Sub: GV.IntVal = LHS.
IntVal - RHS.
IntVal;
break;
745 case Instruction::Mul: GV.IntVal = LHS.
IntVal * RHS.
IntVal;
break;
756 switch (CE->getOpcode()) {
758 case Instruction::FAdd:
760 case Instruction::FSub:
762 case Instruction::FMul:
764 case Instruction::FDiv:
766 case Instruction::FRem:
771 switch (CE->getOpcode()) {
773 case Instruction::FAdd:
775 case Instruction::FSub:
777 case Instruction::FMul:
779 case Instruction::FDiv:
781 case Instruction::FRem:
788 const fltSemantics &Sem = CE->getOperand(0)->getType()->getFltSemantics();
790 switch (CE->getOpcode()) {
792 case Instruction::FAdd:
796 case Instruction::FSub:
801 case Instruction::FMul:
806 case Instruction::FDiv:
811 case Instruction::FRem:
828 OS <<
"ConstantExpr not handled: " << *CE;
836 Result.
FloatVal = cast<ConstantFP>(
C)->getValueAPF().convertToFloat();
839 Result.
DoubleVal = cast<ConstantFP>(
C)->getValueAPF().convertToDouble();
844 Result.
IntVal = cast <ConstantFP>(
C)->getValueAPF().bitcastToAPInt();
847 Result.
IntVal = cast<ConstantInt>(
C)->getValue();
850 if (isa<ConstantPointerNull>(C))
852 else if (
const Function *
F = dyn_cast<Function>(C))
856 else if (
const BlockAddress *BA = dyn_cast<BlockAddress>(C))
858 BA->getBasicBlock())));
872 }
else if (CV || CAZ) {
891 for (
unsigned i = 0; i < elemNum; ++i)
892 if (!isa<UndefValue>(CV->getOperand(i)))
894 CV->getOperand(i))->getValueAPF().convertToFloat();
898 for (
unsigned i = 0; i < elemNum; ++i)
913 for (
unsigned i = 0; i < elemNum; ++i)
914 if (!isa<UndefValue>(CV->getOperand(i)))
916 CV->getOperand(i))->getValueAPF().convertToDouble();
920 for (
unsigned i = 0; i < elemNum; ++i)
935 for (
unsigned i = 0; i < elemNum; ++i)
936 if (!isa<UndefValue>(CV->getOperand(i)))
938 CV->getOperand(i))->getValue();
941 APInt(CV->getOperand(i)->getType()->getPrimitiveSizeInBits(), 0);
946 for (
unsigned i = 0; i < elemNum; ++i)
960 OS <<
"ERROR: Constant unimplemented for type: " << *C->
getType();
970 unsigned StoreBytes) {
971 assert((IntVal.
getBitWidth()+7)/8 >= StoreBytes &&
"Integer too small!");
972 const uint8_t *Src = (
const uint8_t *)IntVal.
getRawData();
977 memcpy(Dst, Src, StoreBytes);
982 while (StoreBytes >
sizeof(uint64_t)) {
983 StoreBytes -=
sizeof(uint64_t);
985 memcpy(Dst + StoreBytes, Src,
sizeof(uint64_t));
986 Src +=
sizeof(uint64_t);
989 memcpy(Dst, Src +
sizeof(uint64_t) - StoreBytes, StoreBytes);
999 dbgs() <<
"Cannot store value of type " << *Ty <<
"!\n";
1021 for (
unsigned i = 0; i < Val.
AggregateVal.size(); ++i) {
1022 if (cast<VectorType>(Ty)->getElementType()->isDoubleTy())
1024 if (cast<VectorType>(Ty)->getElementType()->isFloatTy())
1026 if (cast<VectorType>(Ty)->getElementType()->isIntegerTy()) {
1027 unsigned numOfBytes =(Val.
AggregateVal[i].IntVal.getBitWidth()+7)/8;
1029 (uint8_t*)Ptr + numOfBytes*i, numOfBytes);
1037 std::reverse((uint8_t*)Ptr, StoreBytes + (uint8_t*)Ptr);
1043 assert((IntVal.
getBitWidth()+7)/8 >= LoadBytes &&
"Integer too small!");
1044 uint8_t *Dst =
reinterpret_cast<uint8_t *
>(
1045 const_cast<uint64_t *
>(IntVal.
getRawData()));
1050 memcpy(Dst, Src, LoadBytes);
1056 while (LoadBytes >
sizeof(uint64_t)) {
1057 LoadBytes -=
sizeof(uint64_t);
1059 memcpy(Dst, Src + LoadBytes,
sizeof(uint64_t));
1060 Dst +=
sizeof(uint64_t);
1063 memcpy(Dst +
sizeof(uint64_t) - LoadBytes, Src, LoadBytes);
1101 if (ElemT->isFloatTy()) {
1103 for (
unsigned i = 0; i < numElems; ++i)
1106 if (ElemT->isDoubleTy()) {
1108 for (
unsigned i = 0; i < numElems; ++i)
1111 if (ElemT->isIntegerTy()) {
1113 const unsigned elemBitWidth = cast<IntegerType>(ElemT)->
getBitWidth();
1116 for (
unsigned i = 0; i < numElems; ++i)
1118 (uint8_t*)Ptr+((elemBitWidth+7)/8)*i, (elemBitWidth+7)/8);
1125 OS <<
"Cannot load value of type " << *Ty <<
"!";
1131 DEBUG(
dbgs() <<
"JIT: Initializing " << Addr <<
" ");
1133 if (isa<UndefValue>(Init))
1137 unsigned ElementSize =
1139 for (
unsigned i = 0, e = CP->getNumOperands(); i != e; ++i)
1144 if (isa<ConstantAggregateZero>(Init)) {
1149 if (
const ConstantArray *CPA = dyn_cast<ConstantArray>(Init)) {
1150 unsigned ElementSize =
1152 for (
unsigned i = 0, e = CPA->getNumOperands(); i != e; ++i)
1157 if (
const ConstantStruct *CPS = dyn_cast<ConstantStruct>(Init)) {
1160 for (
unsigned i = 0, e = CPS->getNumOperands(); i != e; ++i)
1166 dyn_cast<ConstantDataSequential>(Init)) {
1168 StringRef Data = CDS->getRawDataValues();
1190 std::map<std::pair<std::string, Type*>,
1194 for (
unsigned m = 0, e =
Modules.size(); m != e; ++m) {
1227 std::vector<const GlobalValue*> NonCanonicalGlobals;
1228 for (
unsigned m = 0, e =
Modules.size(); m != e; ++m) {
1233 if (!LinkedGlobalsMap.empty()) {
1235 LinkedGlobalsMap[std::make_pair(
I->getName(),
I->getType())]) {
1237 if (GVEntry != &*
I) {
1238 NonCanonicalGlobals.push_back(
I);
1244 if (!
I->isDeclaration()) {
1261 if (!NonCanonicalGlobals.empty()) {
1262 for (
unsigned i = 0, e = NonCanonicalGlobals.size(); i != e; ++i) {
1267 assert(Ptr &&
"Canonical global wasn't codegen'd!");
1276 if (!
I->isDeclaration()) {
1277 if (!LinkedGlobalsMap.empty()) {
1279 LinkedGlobalsMap[std::make_pair(
I->getName(),
I->getType())])
1300 if (GA == 0)
return;
1316 : EE(EE), GlobalAddressMap(this) {
1321 return &EES->EE.
lock;
1326 void *OldVal = EES->GlobalAddressMap.
lookup(Old);
1327 EES->GlobalAddressReverseMap.erase(OldVal);
1334 " RAUW on a value it has a global mapping for.");
void * RemoveMapping(const MutexGuard &, const GlobalValue *ToUnmap)
Erase an entry from the mapping table.
opStatus divide(const APFloat &, roundingMode)
static ExecutionEngine *(* MCJITCtor)(Module *M, std::string *ErrorStr, RTDyldMemoryManager *MCJMM, bool GVsWithCode, TargetMachine *TM)
const_iterator end(StringRef path)
Get end iterator over path.
std::vector< GenericValue > AggregateVal
static void * SearchForAddressOfSymbol(const char *symbolName)
Search through libraries for address of a symbol.
double signedRoundToDouble() const
Converts this signed APInt to a double value.
virtual void * getOrEmitGlobalVariable(const GlobalVariable *GV)
LLVMContext & getContext() const
void clearAllGlobalMappings()
uint64_t getZExtValue() const
Get zero extended value.
size_t size() const
size - Get the string size.
unsigned getScalarSizeInBits()
int runFunctionAsMain(Function *Fn, const std::vector< std::string > &argv, const char *const *envp)
The main container class for the LLVM Intermediate Representation.
unsigned getNumParams() const
virtual bool removeModule(Module *M)
2: 32-bit floating point type
ValueT lookup(const KeyT &Val) const
unsigned getPointerSize(unsigned AS=0) const
enable_if_c<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getNumOperands() const
bool hasAppendingLinkage() const
bool isDoubleTy() const
isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type.
void EmitGlobalVariable(const GlobalVariable *GV)
const_iterator begin(StringRef path)
Get begin iterator over path.
virtual void * getPointerToFunctionOrStub(Function *F)
4: 80-bit floating point type (X87)
static APFloat getZero(const fltSemantics &Sem, bool Negative=false)
double roundToDouble(bool isSigned) const
Converts this APInt to a double value.
const Constant * getInitializer() const
APInt LLVM_ATTRIBUTE_UNUSED_RESULT zextOrTrunc(unsigned width) const
Zero extend or truncate to width.
const std::string & getTargetTriple() const
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
GlobalAddressMapTy & getGlobalAddressMap(const MutexGuard &)
StringRef getName() const
static ExecutionEngine *(* InterpCtor)(Module *M, std::string *ErrorStr)
static ExecutionEngine * create(Module *M, bool ForceInterpreter=false, std::string *ErrorStr=0, CodeGenOpt::Level OptLevel=CodeGenOpt::Default, bool GVsWithCode=true)
APInt LLVM_ATTRIBUTE_UNUSED_RESULT urem(const APInt &RHS) const
Unsigned remainder operation.
static const fltSemantics x87DoubleExtended
void dump() const
dump - Support for debugging, callable in GDB: V->dump()
static unsigned getBitWidth(Type *Ty, const DataLayout *TD)
const StructLayout * getStructLayout(StructType *Ty) const
virtual void runStaticConstructorsDestructors(bool isDtors)
bool isThreadLocal() const
If the value is "Thread Local", its value isn't shared by the threads.
void * getPointerToGlobal(const GlobalValue *GV)
void InitializeMemory(const Constant *Init, void *Addr)
opStatus convertToInteger(integerPart *, unsigned int, bool, roundingMode, bool *) const
#define llvm_unreachable(msg)
double getElementAsDouble(unsigned i) const
global_iterator global_begin()
static const bool IsLittleEndianHost
virtual GenericValue runFunction(Function *F, const std::vector< GenericValue > &ArgValues)=0
static void LoadIntFromMemory(APInt &IntVal, uint8_t *Src, unsigned LoadBytes)
const char * data() const
virtual char * getMemoryForGV(const GlobalVariable *GV)
getMemoryforGV - Allocate memory for a global variable.
void LoadValueFromMemory(GenericValue &Result, GenericValue *Ptr, Type *Ty)
static UIntTy RoundUpAlignment(UIntTy Val, unsigned Alignment)
static bool isTargetNullPtr(ExecutionEngine *EE, void *Loc)
isTargetNullPtr - Return whether the target pointer stored at Loc is null.
iterator find(const KeyT &Val)
bool isFirstClassType() const
double fmod(double x, double y);
bool isFloatingPointTy() const
static void onDelete(ExecutionEngineState *EES, const GlobalValue *Old)
EngineBuilder & setCodeModel(CodeModel::Model M)
GenericValue getConstantValue(const Constant *C)
Converts a Constant* into a GenericValue, including handling of ConstantExpr values.
static void onRAUW(ExecutionEngineState *, const GlobalValue *, const GlobalValue *)
unsigned getNumElements() const
Return the number of elements in the Vector type.
EngineBuilder & setAllocateGVsWithCode(bool a)
void StoreValueToMemory(const GenericValue &Val, GenericValue *Ptr, Type *Ty)
Type * getElementType() const
EngineBuilder & setEngineKind(EngineKind::Kind w)
opStatus mod(const APFloat &, roundingMode)
C fmod, or llvm frem.
opStatus convertFromAPInt(const APInt &, bool, roundingMode)
uint64_t getElementOffset(unsigned Idx) const
10: Arbitrary bit width integers
bool hasJIT() const
hasJIT - Check if this targets supports the just-in-time compilation.
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
Guard a section of code with a Mutex.
Type * getParamType(unsigned i) const
Parameter type accessors.
* if(!EatIfPresent(lltok::kw_thread_local)) return false
APInt LLVM_ATTRIBUTE_UNUSED_RESULT trunc(unsigned width) const
Truncate to new width.
virtual void * getPointerToBasicBlock(BasicBlock *BB)=0
STATISTIC(NumInitBytes,"Number of bytes of global vars initialized")
LLVM Constant Representation.
bool hasDLLExportLinkage() const
static ExecutionEngine * createJIT(Module *M, std::string *ErrorStr=0, JITMemoryManager *JMM=0, CodeGenOpt::Level OptLevel=CodeGenOpt::Default, bool GVsWithCode=true, Reloc::Model RM=Reloc::Default, CodeModel::Model CMM=CodeModel::JITDefault)
EngineBuilder & setErrorStr(std::string *e)
bool isFloatTy() const
isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type.
APInt Or(const APInt &LHS, const APInt &RHS)
Bitwise OR function for APInt.
APInt Xor(const APInt &LHS, const APInt &RHS)
Bitwise XOR function for APInt.
friend class EngineBuilder
static bool LoadLibraryPermanently(const char *Filename, std::string *ErrMsg=0)
APInt LLVM_ATTRIBUTE_UNUSED_RESULT sext(unsigned width) const
Sign extend to a new width.
unsigned getBitWidth() const
Return the number of bits in the APInt.
6: 128-bit floating point type (two 64-bits, PowerPC)
APInt LLVM_ATTRIBUTE_UNUSED_RESULT sdiv(const APInt &RHS) const
Signed division function for APInt.
Value * getOperand(unsigned i) const
static void StoreIntToMemory(const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes)
void * getPointerToGlobalIfAvailable(const GlobalValue *GV)
uint64_t getElementAsInteger(unsigned i) const
static UndefValue * get(Type *T)
void clearGlobalMappingsFromModule(Module *M)
static PointerType * getInt8PtrTy(LLVMContext &C, unsigned AS=0)
unsigned getPreferredAlignment(const GlobalVariable *GV) const
Abstract interface for implementation execution of LLVM modules, designed to support both interpreter...
EngineBuilder & setJITMemoryManager(JITMemoryManager *jmm)
APInt LLVM_ATTRIBUTE_UNUSED_RESULT srem(const APInt &RHS) const
Function for signed remainder operation.
void * GVTOP(const GenericValue &GV)
void * updateGlobalMapping(const GlobalValue *GV, void *Addr)
global_iterator global_end()
bool hasExternalWeakLinkage() const
bool hasExternalLinkage() const
static APInt LLVM_ATTRIBUTE_UNUSED_RESULT doubleToBits(double V)
Converts a double to APInt bits.
EngineBuilder & setRelocationModel(Reloc::Model RM)
15: SIMD 'packed' format, or other vector type
uint64_t getTypeAllocSize(Type *Ty) const
opStatus add(const APFloat &, roundingMode)
static sys::Mutex * getMutex(ExecutionEngineState *EES)
opStatus multiply(const APFloat &, roundingMode)
GlobalVariable * getNamedGlobal(StringRef Name)
virtual Function * FindFunctionNamed(const char *FnName)
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
GenericValue PTOGV(void *P)
Class for arbitrary precision integers.
virtual void * getPointerToFunction(Function *F)=0
APInt bitcastToAPInt() const
double bitsToDouble() const
Converts APInt bits to a double.
APInt And(const APInt &LHS, const APInt &RHS)
Bitwise AND function for APInt.
APInt RoundFloatToAPInt(float Float, unsigned width)
Converts a float value into a APInt.
virtual ~ExecutionEngine()
ExecutionEngine * create()
PointerType * getType() const
getType - Global values are always pointers.
bool isX86_FP80Ty() const
isX86_FP80Ty - Return true if this is x86 long double.
void addGlobalMapping(const GlobalValue *GV, void *Addr)
bool isAggregateType() const
const uint64_t * getRawData() const
APInt LLVM_ATTRIBUTE_UNUSED_RESULT udiv(const APInt &RHS) const
Unsigned division operation.
bool isDeclaration() const
float getElementAsFloat(unsigned i) const
const DataLayout * getDataLayout() const
static APInt LLVM_ATTRIBUTE_UNUSED_RESULT floatToBits(float V)
Converts a float to APInt bits.
FunctionType * getFunctionType() const
unsigned getPointerSizeInBits(unsigned AS=0) const
unsigned getNumElements() const
getNumElements - Return the number of elements in the array or vector.
SmallVector< Module *, 1 > Modules
unsigned getPrimitiveSizeInBits() const
const GlobalValue * getGlobalValueAtAddress(void *Addr)
uint64_t getTypeStoreSize(Type *Ty) const
Helper class for helping synchronize access to the global address map table.
bool hasLocalLinkage() const
TargetMachine * selectTarget()
Type * getElementType() const
getElementType - Return the element type of the array/vector.
3: 64-bit floating point type
Type * getReturnType() const
ExecutionEngineState(ExecutionEngine &EE)
ExecutionEngine(Module *M)
bool hasDLLImportLinkage() const
uint64_t getTypeSizeInBits(Type *Ty) const
const Target & getTarget() const
APInt LLVM_ATTRIBUTE_UNUSED_RESULT zext(unsigned width) const
Zero extend to a new width.
APInt RoundDoubleToAPInt(double Double, unsigned width)
Converts the given double value into a APInt.
std::map< void *, AssertingVH< const GlobalValue > > & getGlobalAddressReverseMap(const MutexGuard &)
opStatus subtract(const APFloat &, roundingMode)
static ExecutionEngine *(* JITCtor)(Module *M, std::string *ErrorStr, JITMemoryManager *JMM, bool GVsWithCode, TargetMachine *TM)
INITIALIZE_PASS(GlobalMerge,"global-merge","Global Merge", false, false) bool GlobalMerge const DataLayout * TD
EngineBuilder & setOptLevel(CodeGenOpt::Level l)
float bitsToFloat() const
Converts APInt bits to a double.
bool erase(const KeyT &Val)
bool isVoidTy() const
isVoidTy - Return true if this is 'void'.
5: 128-bit floating point type (112-bit mantissa)