search for: getdoubleti

Displaying 20 results from an estimated 52 matches for "getdoubleti".

Did you mean: getdoublety
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 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());
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 >
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 +
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(){
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*>
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
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
2010 Jan 04
2
[LLVMdev] Getting Kaleidoscope to compile
I tried apt-get install llvm-dev just now, and it says it was already installed, and when I again try compiling toy.cpp, it gives the same set of error messages. On Mon, Jan 4, 2010 at 10:27 AM, Oleg Knut <oleg77 at gmail.com> wrote: > Probably you missed to install llvm-dev package with headers for llvm. > > 2010/1/4 Russell Wallace <russell.wallace at gmail.com> >>
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
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
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*>
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
Is there a recommended way to retrieve the original type from an AllocaInst object? For example, I am creating alloca instructions using the IRBuilder interface like: alloca = builder.CreateAlloca( Type::getDoubleTy( context ), 0, variableName.c_str() ); and I place the alloca into a symbol table. Later when I am generating instructions for an assignment operation, I want to check the type of
2011 Nov 14
2
[LLVMdev] Transferring value* in LLVM
I sure that is.What could be other reasons for such error? Yakov On Mon, Nov 14, 2011 at 5:44 PM, Duncan Sands <baldrick at free.fr> wrote: > On 14/11/11 16:39, Yakov Malinkovich wrote: > >> It doesnt work it fails with assertation that cast is invalid .What >> could be done? >> > > Maybe src doesn't have Float type? > > Ciao, Duncan. > > >
2020 Jan 14
2
sizeof implementation: how to get size as a constantInt?
I'm implementing c style "sizeof()", and I did as http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt illuarstrated, and it works find, here's an example of my implementation: auto *p = builder.CreateGEP(structTy, llvm::ConstantPointerNull::get(pointerTy), constint1); auto *size =
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
2011 May 31
0
[LLVMdev] How to identify LLVM version?
Kangkook Jee <aixer77 at gmail.com> writes: > 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
2011 Nov 14
0
[LLVMdev] Transferring value* in LLVM
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 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
2011 Nov 14
0
[LLVMdev] Transferring value* in LLVM
On 14/11/11 16:39, Yakov Malinkovich wrote: > It doesnt work it fails with assertation that cast is invalid .What > could be done? Maybe src doesn't have Float type? Ciao, Duncan. > > > 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. >> >>