similar to: ConstantFP->getType() is not right

Displaying 20 results from an estimated 300 matches similar to: "ConstantFP->getType() is not right"

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
2010 Mar 19
2
[LLVMdev] JIT : Does it cache the compiled code of executed functions upon runFunction(..)?
Reid, Thanks! You were right! Changing the code to: float (*theF)(float) = (float (*)(float)) EE -> getPointerToFunction(f); float retVal = theF(arg1); made the difference. Now it is dozens of times faster! 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
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
2013 May 22
1
[LLVMdev] Best strategy to add a parameter to a function
I am trying to build a function (C++ Builder) and at the same time extend its parameter set. Here's what I try to do: Value* arg0 = add_param_float("arg0"); Value* tmp = builder->CreateFAdd(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
2014 May 05
3
[LLVMdev] get unsigned integer pattern for ConstantFP
What is the proper way to get the bit pattern associated with a ConstantFP? The 32 bit pattern if MVT::f32 or pair of 32 bit patterns with MVT::f64 ? Tia. Reed
2010 Jan 04
4
[LLVMdev] Getting Kaleidoscope to compile
Hi all, I've started work on a new programming language for which I am considering using LLVM as the backend, and trying to experiment with it using the Kaleidoscope demo compiler. Taking the full source listing from http://llvm.org/docs/tutorial/LangImpl3.html#code and trying to compile it with the provided instructions gives me the following errors: a at a-desktop:~$ g++ -g -O3 toy.cpp
2019 Jan 02
2
JIT compiler, Windows, external functions like cos
Hello LLVM team, our software FluidSIM (www.fluidsim.de) simulates pneumatic, hydraulic and electric circuits. For the mathematical models we use the language Modelica (www.modelica.org). We developed our own Modelica simulator which solves the dynamical created algebraic differential equation systems. One tool is our small JIT compiler, which compiles mathematical expressions like “2*x0 +
2010 Jan 04
0
[LLVMdev] Getting Kaleidoscope to compile
Probably you missed to install llvm-dev package with headers for llvm. 2010/1/4 Russell Wallace <russell.wallace at gmail.com> > Hi all, > > I've started work on a new programming language for which I am > considering using LLVM as the backend, and trying to experiment with > it using the Kaleidoscope demo compiler. > > Taking the full source listing from >
2016 Sep 19
3
llvm interpreter does not find function defined by addGlobalMapping
Hi, I want to use a function defined in c(++)-code from code generated by llvm. For this I use ExecutionEngine.addGlobalMapping(). I started with the JIT execution engine and everything worked, then I switched to the interpreter engine and it stopped working, but only if compiled on a Linux system. More precisely it works if I use llvm 3.8.1 + gcc (Linux) + JIT llvm 3.8.0 + mingw-gcc
2013 Sep 19
1
[LLVMdev] JIT compiled intrinsics calls is call to null pointer
Hi Andrew, this sounded a plausible explanation, because the X86 processor does not have an instruction to calculate the power function. So I tried the llvm.sin.f32 intrinsic, as the X86 processor family does have an instruction for that, but I still get the same problem. While you may still be right, there is at least something else going on as well. Thanks for your input, though. Taco.
2011 May 31
2
[LLVMdev] How to identify LLVM version?
Hi, all I'd like to write a code that can build different codes based on LLVM version. Like code snippets in the below. #ifdef __LLVM_29__ PHINode *PN = Builder.CreatePHI (Type::getDoubleTy(getGlobalContext()), 2, "iftmp"); #elif __LLVM_28__ PHINode *PN = Builder.CreatePHI (Type::getDoubleTy(getGlobalContext()), "iftmp"); #else assert ("wrong
2012 Apr 23
1
[LLVMdev] Problem about the type of Function's arguement in llvm
I read the tutorial doc and some info of SSA, finally understand it. Thanks for your help. And the segmentation error of loading arguementation occurs, (gdb error info) Program received signal SIGSEGV, Segmentation fault. 0x0855bb68 in llvm::LoadInst::LoadInst(llvm::Value*, char const*, bool, llvm::Instruction*) () code is like follows: //#include necessary header files int main(){
2015 Apr 16
3
[LLVMdev] double* to <2 x double>*
Does anyone know how to instrument *double* to <2 x doulbe>**, e.g., 2.2 --> <2.2, 2.2>? For example, I want to change the following IR code %arrayidx1 = getelementptr inbounds [100 x double]* @main.B, i32 0, i32 %i.021 %1 = load double* %arrayidx1, align 4, !tbaa !0 to: %arrayidx1 = getelementptr inbounds [100 x double]* @main.B, i32 0, i32 %i.021 %1 = bitcast double* %arrayidx1
2009 Aug 23
1
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
2009/8/22 Bill Wendling <isanbard at gmail.com>: > I think you might have to provide an empty list if your function doesn't > take parameters. Maybe using an irbuilder would help? It does take one parameter. Here's the important bits: // My Function extern "C" void print(double X) { printf("%f\n", X); } // Args type std::vector<const Type*>
2011 Nov 14
2
[LLVMdev] Transferring value* in LLVM
Hello I want to transfer value (Value* src) of the type `FloatTyID` to `DoubleTyID`(I need all floats to be saved as 8 bytes).I have tried: builder.CreateCast(llvm::Instruction::FPExt, src, llvm::Type::getDoubleTy(llvmContext),””) I don`t know if I use CreateCast correctly and if this approach is correct at all. Thank you. Yakov -------------- next part -------------- An HTML attachment
2012 Apr 22
0
[LLVMdev] Problem about the type of Function's arguement in llvm
hi On Sun, Apr 22, 2012 at 8:36 PM, Jianfei Hu <hujianfei258 at gmail.com> wrote: > in the  tutorial of official llvm doc, chapter 3, it deals with arguement of > function as follow: > > for (Function::arg_iterator AI = F->arg_begin(); Idx != Args.size(); >        ++AI, ++Idx) { >     AI->setName(Args[Idx]); > >     // NamedValues is map<string, Value*>
2011 Nov 14
2
[LLVMdev] Transferring value* in LLVM
It doesnt work it fails with assertation that cast is invalid .What could be done? On 11/14/11, Duncan Sands <baldrick at free.fr> wrote: > Hi Yakov, that looks correct to me. You can also use CreateFPExt which is > slightly simpler. > > Ciao, Duncan. > > >> I want to transfer value (Value* src) of the type `FloatTyID` to >> `DoubleTyID`(I >> need all
2016 May 17
3
External function resolution: MCJIT vs ORC JIT
When using ORC JIT, I'm having trouble with external function resolution (that is, of a function defined in the app, with C linkage). I add a declaration for the function to my IR, and when I use MCJIT, it finds it and all is well, But when I use ORC JIT (I *think* correctly, at least it closely matches what I see in the tutorial), I get an LLVM error, "Program used external function
2012 Apr 22
2
[LLVMdev] Problem about the type of Function's arguement in llvm
in the tutorial of official llvm doc, chapter 3, it deals with arguement of function as follow: for (Function::arg_iterator AI = F->arg_begin(); Idx != Args.size(); ++AI, ++Idx) { AI->setName(Args[Idx]); // NamedValues is map<string, Value*> NamedValues[Args[Idx]] = AI; and when it try to get the value of arguement, it simply does: Value
2009 Aug 22
0
[LLVMdev] Having JIT resolve extern "C" functions declared in executible
I think you might have to provide an empty list if your function doesn't take parameters. Maybe using an irbuilder would help? -bw On Aug 22, 2009, at 2:13 PM, Renato Golin <rengolin at systemcall.org> wrote: > 2009/7/4 Albert Graef <Dr.Graef at t-online.de>: >> This is all I ever needed to interface to C functions using LLVM. >> It's >> really