search for: getfloatty

Displaying 12 results from an estimated 12 matches for "getfloatty".

2019 Sep 26
2
ConstantFP->getType() is not right
Hi, I want to create a double constant from a float constant, here's my code: auto* constFloat1 = static_cast<llvm::ConstantFP*>(llvm::ConstantFP::get(llvm::Type::getFloatTy(context), 3.1)); assert(constFloat1->getType() == llvm::Type::getFloatTy(context)); auto* constFloat2 = llvm::ConstantFP::get(llvm::Type::getDoubleTy(context), constFloat1->getValueAPF()); assert(constFloat2->getType() == llvm::Type::getDoubleTy(context)); but the second assert...
2010 Mar 19
2
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
...er! I don't really understand the cause though.. Why doesn't ExecutionEngine cope well with "define float @someFunc(float %x)" and needs this trick ? (but copes well with "define i32 @someFunc(i32 %x) ) The function was generated using "getOrInsertFunction(name, Type::getFloatTy(ctx), Type::getFloatTy(ctx), (Type*)NULL); And the orginal slow execution was: std::vector<GenericValue> args(1); args[0].FloatVal = 8.0f; GenericValue retVal = EE -> runFunction(f, args); return retVal.FloatVal; -- Regards, Gabi http://bugspy.net
2013 Sep 18
2
[LLVMdev] JIT compiled intrinsics calls is call to null pointer
Hi everyone, I am trying to call an LLVM intrinsic (llvm.pow.f32), inserted with the following call: std::vector<llvm::Type *> arg_types;arg_types.push_back(llvm::Type::getFloatTy(context));auto function=llvm::Intrinsic::getDeclaration(module, llvm::Intrinsic::pow, arg_types);auto result=ir_builder->CreateCall(function, args); When I try to execute the code generated by the JIT compiler, I see that the intrinsic is not compiled into a math coprocessor instruction, bu...
2010 Mar 19
0
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
...stand the cause though.. > Why doesn't ExecutionEngine cope well with "define float > @someFunc(float %x)" and needs this trick ?  (but copes well with > "define i32 @someFunc(i32 %x) ) > > The function was generated using "getOrInsertFunction(name, > Type::getFloatTy(ctx), Type::getFloatTy(ctx), (Type*)NULL); > > And the orginal slow execution was: > > std::vector<GenericValue> args(1); > args[0].FloatVal = 8.0f; > GenericValue retVal =  EE -> runFunction(f, args); > return retVal.FloatVal; > > > > > > -- > Reg...
2013 May 22
1
[LLVMdev] Best strategy to add a parameter to a function
...d(arg0,some_previous_value); Value* arg1 = add_param_float("arg1"); The function add_param_float should add a 'float' parameter to the function and return its value. Right now it's implemented like this Value* add_param_float() { return new llvm::Argument( llvm::Type::getFloatTy(llvm::getGlobalContext()) , param_next() , mainFunc ); } where param_next just figures some new, unused name for the argument and mainFunc is the function being built. This works to a certain extent. I am seeing issues with certain type printers and I assume the way the argument is added to th...
2013 Sep 19
1
[LLVMdev] JIT compiled intrinsics calls is call to null pointer
...ection. Cheers, Andrew On Wed, Sep 18, 2013 at 8:32 AM, Taco H. in den Bosch <taco at heddesit.nl> wrote: Hi everyone, I am trying to call an LLVM intrinsic (llvm.pow.f32), inserted with the following call: std::vector<llvm::Type *> arg_types;arg_types.push_back(llvm::Type::getFloatTy(context)); auto function=llvm::Intrinsic::getDeclaration(module, llvm::Intrinsic::pow, arg_types);auto result=ir_builder->CreateCall(function, args); When I try to execute the code generated by the JIT compiler, I see that the intrinsic is not compiled into a math coprocessor instruction...
2016 May 17
3
External function resolution: MCJIT vs ORC JIT
...ObjLayerT Objlayer; CompileLayerT Compilelayer (Objlayer, llvm::orc::SimpleCompiler(*TM)); std::unique_ptr<llvm::Module> M (new llvm::Module("module", Context)); M->setDataLayout (*DL); // Declare stub for external function sqr auto type_float = llvm::Type::getFloatTy (Context); llvm::Type* one_float[] = { type_float }; llvm::FunctionType *functype_ff = llvm::FunctionType::get (type_float, one_float, false); llvm::Function::Create (functype_ff, llvm::Function::ExternalLinkage, "sqr", M.get()); // Create myfu...
2009 Aug 14
0
[LLVMdev] How shall we modify llvm's OCaml binding to support LLVMContext?
...partially ported the OCaml bindings to support LLVMContext, and I wanted to get people's opinion on how to implement it in the API. For the LLVM's C++ api, many key functions were modified to only take a LLVMContext, such as replacing the global variable Type::FloatTy with a function Type::getFloatTy(LLVMContext&). For llvm-c though, we need to maintain backwards compatibility so we've modified LLVMFloatType() to internally use getGlobalContext(), and added LLVMFloatTypeInContext(LLVMContextRef) in order to explicitly choose which context to use. So, the question is what do we do with O...
2015 Jan 15
2
[LLVMdev] AllocaInst for FunctionType?
Hi, I'm trying to get my head around c++ - IR - c++ API and getting used tramform manual information to code. The manual states alloca is defined for <type>. FunstionType is a type, so alloca for functionType should be possible? Not? If we have a valid Module *m we can get an allocate instruction allocating space for a non-argumented function as follows: AllocaInst* pa2 = new
2016 May 19
2
External function resolution: MCJIT vs ORC JIT
...CompileLayerT Compilelayer (Objlayer, llvm::orc::SimpleCompiler(*TM)); > std::unique_ptr<llvm::Module> M (new llvm::Module("module", Context)); > M->setDataLayout (*DL); > > // Declare stub for external function sqr > auto type_float = llvm::Type::getFloatTy (Context); > llvm::Type* one_float[] = { type_float }; > llvm::FunctionType *functype_ff = llvm::FunctionType::get (type_float, one_float, false); > llvm::Function::Create (functype_ff, llvm::Function::ExternalLinkage, > "sqr", M.get());...
2016 May 20
0
External function resolution: MCJIT vs ORC JIT
...ilelayer (Objlayer, llvm::orc::SimpleCompiler(*TM)); >> std::unique_ptr<llvm::Module> M (new llvm::Module("module", Context)); >> M->setDataLayout (*DL); >> >> // Declare stub for external function sqr >> auto type_float = llvm::Type::getFloatTy (Context); >> llvm::Type* one_float[] = { type_float }; >> llvm::FunctionType *functype_ff = llvm::FunctionType::get >> (type_float, one_float, false); >> llvm::Function::Create (functype_ff, llvm::Function::ExternalLinkage, >> &...
2016 May 22
1
External function resolution: MCJIT vs ORC JIT
...lelayer (Objlayer, llvm::orc::SimpleCompiler(*TM)); >> std::unique_ptr<llvm::Module> M (new llvm::Module("module", Context)); >> M->setDataLayout (*DL); >> >> // Declare stub for external function sqr >> auto type_float = llvm::Type::getFloatTy (Context); >> llvm::Type* one_float[] = { type_float }; >> llvm::FunctionType *functype_ff = llvm::FunctionType::get (type_float, one_float, false); >> llvm::Function::Create (functype_ff, llvm::Function::ExternalLinkage, >> "sqr&...