search for: genericvalu

Displaying 20 results from an estimated 239 matches for "genericvalu".

Did you mean: genericvalue
2007 Jul 17
2
[LLVMdev] GenericValue changes from 1.8 to 2.0
Hi all, I've been quiet for a while, but I'm liable to be less so now that I'm starting on porting our model checker from LLVM 1.8 to 2.0. One thing that is puzzling me somewhat are the changes made to the GenericValue union, which is now a struct. I haven't found any mention of this on the llvm site or in the archives, so it may be that I am the only one who cares about it (I think it only really appears in the non-jitted interpreter code, which was the basis of the inner loop of our model checker). I...
2005 Mar 08
1
[LLVMdev] Making Constants from GenericValues
I'm trying to turn some GenericValues into Constants in the interpreter using code like this, in a switch statement: case Type::IntTyID: SI = ConstantSInt::get(FB->getType(), ArgVals[i].IntVal); params.push_back(UI); UI->dump(); //for testing break; FB is a Function::ArgumentListType::iter...
2007 Jul 17
0
[LLVMdev] GenericValue changes from 1.8 to 2.0
...0700, Sarah Thompson wrote: > Hi all, > > I've been quiet for a while, but I'm liable to be less so now that I'm > starting on porting our model checker from LLVM 1.8 to 2.0. We missed you! :) > One thing > that is puzzling me somewhat are the changes made to the GenericValue > union, which is now a struct. I haven't found any mention of this on the > llvm site or in the archives, so it may be that I am the only one who > cares about it (I think it only really appears in the non-jitted > interpreter code, which was the basis of the inner loop of our...
2007 Jul 17
3
[LLVMdev] GenericValue changes from 1.8 to 2.0
...there wasn't at all nice to look at, so you all lucked out by not catching it from me, I think! > This was done to support arbitrary precision integers in the interpreter > (about the only way to test them). > > Yes, I'd assumed as much. >> I took advantage of the old GenericValue fitting into a 64-bit word, >> since it was fairly obviously intended to be exactly that, with the >> union serving to provide convenient access to various ways that it might >> be formatted. >> > > Right. Unfortunately, there are integers now that don't...
2007 Jul 17
2
[LLVMdev] GenericValue changes from 1.8 to 2.0
Chris Lattner wrote: > On Tue, 17 Jul 2007, Sarah Thompson wrote: > > >> Do I understand correctly that there is nothing that the current gcc >> front end generates that wouldn't fit an old-style GenericValue? I'm >> wondering if this might be an interim approach that would avoid me >> needing to rewrite huge amounts of code, and since we're not likely to >> be supporting anything other than C and C++ in the forseeable future, it >> makes some sense. Model checking VHDL...
2007 Jul 17
0
[LLVMdev] GenericValue changes from 1.8 to 2.0
On Tue, 17 Jul 2007, Sarah Thompson wrote: > Do I understand correctly that there is nothing that the current gcc > front end generates that wouldn't fit an old-style GenericValue? I'm > wondering if this might be an interim approach that would avoid me > needing to rewrite huge amounts of code, and since we're not likely to > be supporting anything other than C and C++ in the forseeable future, it > makes some sense. Model checking VHDL and Verilog can...
2008 Sep 08
0
[LLVMdev] OCaml bindings to LLVM
...; Firstly, I noticed that the execute engine is very slow, taking > milliseconds to call a JIT compiled function. Is this an inherent > overhead or am I calling it incorrectly or is this something that > can be optimized in the OCaml bindings? The high-level calling convention using GenericValue is going to be very slow relative to a native function call. This is true in C++, but even moreso in Ocaml, which must cons up a bunch of objects on the heap for each call. To get best performance, you would want to avoid fine-grained calls into JIT'd code, e.g. by iterating over input...
2013 Jan 08
2
[LLVMdev] ExecutionEngine always comes back NULL
Sorry I forgot to add code that I use to run code: /* Executes the AST by running the main function */ GenericValue CodeGenContext::runCode() { std::cout << "Running code...\n"; ExecutionEngine *ee = EngineBuilder(module).create(); vector<GenericValue> noargs; GenericValue v = ee->runFunction(mainFunction, noargs); std::cout << "Code was run.\n"; return v; } Il 08/01/2...
2010 Aug 19
3
[LLVMdev] using external functions from llvm
...10, at 8:07 AM, Alec Benzer wrote: > > Is there documentation somewhere on how to call external functions from > llvm? The only guide I found was this: > http://www.gearleaf.com/blog/post/44, and it doesn't seem to be working > for me. > > I have a function: > > llvm::GenericValue lle_X_create_number_object(llvm::FunctionType* ft, const > std::vector<llvm::GenericValue>& args) > { > llvm_object_structure* result = new llvm_object_structure; > result->typeIdx = TypeSystem::number; > result->data = reinterpret_cast<unsigned char*>(ne...
2007 Jul 18
0
[LLVMdev] GenericValue changes from 1.8 to 2.0
Sarah Thompson wrote: > Chris Lattner wrote: > >> On Tue, 17 Jul 2007, Sarah Thompson wrote: >> >> >> >>> Do I understand correctly that there is nothing that the current gcc >>> front end generates that wouldn't fit an old-style GenericValue? I'm >>> wondering if this might be an interim approach that would avoid me >>> needing to rewrite huge amounts of code, and since we're not likely to >>> be supporting anything other than C and C++ in the forseeable future, it >>> makes some sense. Mode...
2010 Aug 19
2
[LLVMdev] using external functions from llvm
Is there documentation somewhere on how to call external functions from llvm? The only guide I found was this: http://www.gearleaf.com/blog/post/44, and it doesn't seem to be working for me. I have a function: llvm::GenericValue lle_X_create_number_object(llvm::FunctionType* ft, const std::vector<llvm::GenericValue>& args) { llvm_object_structure* result = new llvm_object_structure; result->typeIdx = TypeSystem::number; result->data = reinterpret_cast<unsigned char*>(new double(args[0].DoubleVa...
2004 Aug 09
5
[LLVMdev] API on JIT, code snippets
...The code in "reid.cpp" compiles but I haven't tested it. I'll leave that to you. There is only one remaining item that I don't know how to do. After ExecutionEngine::runFunction, you want to extract the result int value from the function. The runFunction method returns a GenericValue but I don't see an obvious way to get an actual value from this class. Misha: can you help out with "GenericValue" ? Thanks, Reid. Valery A.Khamenya wrote: > Reid wrote: > > >>I have to agree with Misha on this. None of us knows "everything" about &gt...
2004 Aug 09
0
[LLVMdev] API on JIT, code snippets
...t; compiles but I haven't tested it. I'll leave that to you. Cool, thanks Reid! > There is only one remaining item that I don't know how to do. After > ExecutionEngine::runFunction, you want to extract the result int value from the > function. The runFunction method returns a GenericValue but I don't see an > obvious way to get an actual value from this class. I'm not Misha, but if you have a GenericValue that is an int, just use GV.IntVal to get at it. GenericValue is just a union (defined in include/llvm/ExecutionEngine/GenericValue.h), which can represent any first-...
2008 Oct 30
3
[LLVMdev] Problem executing code with lli...
...rough lli it segfaults and the program aborts. This is the stack trace after execution. lli((anonymous namespace)::PrintStackTrace()+0x1f)[0x67cc7f] lli((anonymous namespace)::SignalHandler(int)+0x172)[0x67cf72] /lib64/tls/libc.so.6[0x2a95e4b300] lli(llvm::ExecutionEngine::LoadValueFromMemory(llvm::GenericValue*, llvm::Type const*)+0x182)[0x4be4f2] lli(llvm::InstVisitor<llvm::Interpreter, void>::visit(llvm::Instruction&)+0x1fe)[0x4b648e] lli(llvm::Interpreter::run()+0x2b)[0x4b179b] lli(llvm::Interpreter::runFunction(llvm::Function*, std::vector<llvm::GenericValue, std::allocator<llvm::Gen...
2008 Sep 06
4
[LLVMdev] OCaml bindings to LLVM
I'm having another play with LLVM using the OCaml bindings for a forthcoming OCaml Journal article and I have a couple of remarks: Firstly, I noticed that the execute engine is very slow, taking milliseconds to call a JIT compiled function. Is this an inherent overhead or am I calling it incorrectly or is this something that can be optimized in the OCaml bindings? Secondly, I happened to
2012 Jan 12
4
[LLVMdev] How to pass an array to a function using GenericValue
Hi, My application generates some LLVM assembly code which I then convert to IR code using ParseAssemblyString. If I have the following LLVM assembly code: define double @test() { ret double 1.230000e+02 } then, using ExecutionEngine::runFunction, I get a GenericValue return value which DoubleVal property is indeed equal to 123. So, all is fine there. However, if I have the following LLVM assembly code: define void @test(double* %data) { %1 = getelementptr inbounds double* %data, i64 1 store double 1.230000e+02, double* %1, align 8 %2 =...
2019 Jul 17
2
Help to understand LoadValueFromMemory
...fread function. I'm at the point where source refers to the GetElementPtrInst ( pointer to the buffer where fread stored the data - %5 in my case ) and the fread() has been already called. I thought the correct approach to achieve what I need was: ExecutionContext& SF = ECStack.back(); GenericValue SRC = getOperandValue(source, SF); GenericValue* Ptr = (GenericValue*)GVTOP(SRC); GenericValue Result; source->getPointerOperand()->getType()->dump(); //[40 x i8]* LoadValueFromMemory(Result, Ptr, source->getPointerOperand()->getType()); and use Result.PointerVal ... In th...
2013 Jan 08
0
[LLVMdev] ExecutionEngine always comes back NULL
On Jan 8, 2013, at 8:09 , Manuele Conti <manuele.conti at sirius-es.it> wrote: > Sorry I forgot to add code that I use to run code: > /* Executes the AST by running the main function */ > GenericValue CodeGenContext::runCode() { > std::cout << "Running code...\n"; > ExecutionEngine *ee = EngineBuilder(module).create(); > < > div class="line" id="LC37" style="margin: 0px; padding: 0px 0px 0px 10px; border: 0px;"> > vector<G...
2013 Feb 20
0
[LLVMdev] LLVM Interpreter & QSort
...ABA: __GI_qsort_r.constprop.1 (msort.c:46) ==9222==    by 0x5054E87: ffi_call_unix64 (in /usr/local/lib/libffi.so.6.0.1) ==9222==    by 0x505479C: ffi_call (in /usr/local/lib/libffi.so.6.0.1) ==9222==    by 0x8604AE: llvm::Interpreter::callExternalFunction(llvm::Function*, std::vector<llvm::GenericValue, std::allocator<llvm::GenericValue> > const&) (in /usr/local/bin/lli) ==9222==    by 0x85B49A: llvm::Interpreter::callFunction(llvm::Function*, std::vector<llvm::GenericValue, std::allocator<llvm::GenericValue> > const&) (in /usr/local/bin/lli) ==9222==    by 0...
2013 Feb 20
0
[LLVMdev] LLVM Interpreter & Qsort
...x5CA7ABA: __GI_qsort_r.constprop.1 (msort.c:46) ==9222== by 0x5054E87: ffi_call_unix64 (in /usr/local/lib/libffi.so.6.0.1) ==9222== by 0x505479C: ffi_call (in /usr/local/lib/libffi.so.6.0.1) ==9222== by 0x8604AE: llvm::Interpreter::callExternalFunction(llvm::Function*, std::vector<llvm::GenericValue, std::allocator&lt;llvm::GenericValue> > const&) (in /usr/local/bin/lli) ==9222== by 0x85B49A: llvm::Interpreter::callFunction(llvm::Function*, std::vector<llvm::GenericValue, std::allocator&lt;llvm::GenericValue> > const&) (in /usr/local/bin/lli) ==9222== by 0...