search for: anarg

Displaying 20 results from an estimated 32 matches for "anarg".

2005 May 27
3
[LLVMdev] Lightweight code loader
...al to the JIT. It would not support nearly as much functionality as the JIT (though it would have similar code). Here is a very loose use case - does this seem reasonable? **** #include modulecompiler #include module_loader char * countdown_function = "int %countdown (int %AnArg) {\n" " %result = call fastcc int %foo-int (int %AnArg) \n" " ret int %result\n" "}\n" "fastcc int %foo-int (int %AnArg) {\n" "EntryBlock:\n" " %cond = setle int %AnArg, 2\n" " br bool %cond, label %...
2005 May 12
2
[LLVMdev] Scheme + LLVM JIT
...re is a sketch of what the fib example would look like: #include "llvm_c.h" /* Everything takes and recieves void * pointers. This to avoid redefining C++ types. This is the C 'version' of the Fib example, at least in spirit. */ char* fib_function = "int %fib (int %AnArg) {" " EntryBlock: " " %cond = setle int AnArg, 2" " branch bool %cond, label return, label recur" " return:" " ret int 1" " recur:" " %sub1 = sub int %AnArg, 1" " %fibx1 = call tail int %fib (int %sub1) &quot...
2004 Sep 23
2
[LLVMdev] struct and class under VC7.1
...t; about that too. It's not just linking. You are right... BTW, I've just fixed that problem in my checkout and, among others terrible hacks, here I am: :\home\arathorn\sandbox\llvm>HowToUseJIT.exe We just constructed this LLVM module: implementation ; Functions: int %add1(int %AnArg) { EntryBlock: %addresult = add int 1, %AnArg ; <int> [#uses=1] ret int %addresult } int %foo() { EntryBlock: %add1 = call int %add1( int 10 ) ; <int> [#uses=1] ret int %add1 } Running foo: Result: 11 D:\home\arathorn\sand...
2010 Apr 29
2
[LLVMdev] Why the same code is much slower in JIT compared to separate executable?
...ee that with argument 45 JIT runs for 11.3sec and executable runs for 7.5sec. Why there is such difference? Yuri -------- fib.ll -------- ; ModuleID = 'all.bc' @.str = private constant [12 x i8] c"fib(%i)=%i\0A\00", align 1 ; <[12 x i8]*> [#uses=1] define i32 @fib(i32 %AnArg) { EntryBlock: %cond = icmp sle i32 %AnArg, 2 ; <i1> [#uses=1] br i1 %cond, label %return, label %recurse return: ; preds = %EntryBlock ret i32 1 recurse: ; preds = %EntryBlock %arg = sub...
2005 May 27
0
[LLVMdev] Lightweight code loader
Alexander, Yes, a patch like that would be accepted. Fewer dependencies = good :) Some notes on doing this: (1) Please make sure you use the std c++ iostream libraries for doing I/O. No native calls (we end up with portability problems). If you need something that must be ported, please add it to lib/System (2) You should also use the sys::Path class (include/llvm/System/Path.h) for handling
2006 Apr 13
2
[LLVMdev] standalone llvm
...ms that create LLVM IR on the fly and JIT compile it. I'm trying to take assembly and create machine code I can execute. How close am I ? Simon. int main() { Module *M = NULL; char *AsmString = "; ModuleID = 'test'\n\ \n\ implementation ; Functions:\n\ \n\ int %add1(int %AnArg) {\n\ EntryBlock:\n\ %addresult = add int 1, %AnArg ; <int> [#uses=1]\n\ ret int %addresult\n\ }\n\ "; M = ParseAssemblyString(AsmString, NULL); ExistingModuleProvider* MP = new ExistingModuleProvider(M); ExecutionEngine* EE = ExecutionEngine::create(MP,...
2005 May 27
2
[LLVMdev] Lightweight code loader
On May 16, Chris Lattner wrote: > On Mon, 16 May 2005, Alexander Friedman wrote: > > Would it be possible (ie, relatively straitforward) to do the > > following: Take the code in module A, compile it with the JIT (since > > we cannot make libraries in Windows), and save the resulting binary > > goo in some file. Later (in a different instance of the runtime), with >
2005 May 10
0
[LLVMdev] Scheme + LLVM JIT
On Thu, 5 May 2005, Alexander Friedman wrote: >>> Does there happen to be a C interface to the jit ? Our scheme impl >>> has a good FFI, but it doesn't do C++. If not, this is no big deal, >>> and i'll just write something myself. >> >> No, but such bindings would be *very useful*. And since there might be >> other people who need them this
2005 May 13
0
[LLVMdev] Scheme + LLVM JIT
...gt; #include "llvm_c.h" > > /* > Everything takes and recieves void * pointers. This to avoid redefining C++ > types. Makes sense. > This is the C 'version' of the Fib example, at least in spirit. > */ > > char* fib_function = > "int %fib (int %AnArg) {" > > " EntryBlock: " > " %cond = setle int AnArg, 2" > " branch bool %cond, label return, label recur" > > " return:" > " ret int 1" > > " recur:" > " %sub1 = sub int %AnArg, 1" > " %...
2004 Sep 23
0
[LLVMdev] struct and class under VC7.1
...right... > > BTW, I've just fixed that problem in my checkout and, among others > terrible hacks, here I am: > > :\home\arathorn\sandbox\llvm>HowToUseJIT.exe > We just constructed this LLVM module: > > > implementation ; Functions: > > int %add1(int %AnArg) { > EntryBlock: > %addresult = add int 1, %AnArg ; <int> [#uses=1] > ret int %addresult > } > > int %foo() { > EntryBlock: > %add1 = call int %add1( int 10 ) ; <int> > [#uses=1] > ret int %add1...
2005 May 27
0
[LLVMdev] Lightweight code loader
...at's even better as its a completely separate thing. > > Here is a very loose use case - does this seem reasonable? > > **** > > #include modulecompiler > > #include module_loader > > char * countdown_function = > "int %countdown (int %AnArg) {\n" > " %result = call fastcc int %foo-int (int %AnArg) \n" > " ret int %result\n" > "}\n" > "fastcc int %foo-int (int %AnArg) {\n" > "EntryBlock:\n" > " %cond = setle int %AnArg, 2\n" >...
2004 Nov 05
0
[LLVMdev] Re: LLVM Visual Studio Project files
...ven knew it was there to be checked in, as it's a hidden file. This file had hard-coded paths to Morten's setup, and even had his breakpoints in it. So... once these problems are fixed, I run fibonacci and get the following output: --------- implementation ; Functions: int %fib(int %AnArg) { EntryBlock: %cond = setle int %AnArg, 2 ; <bool> [#uses=1] br bool %cond, label %return, label %recurse return: ; preds = %EntryBlock ret int 1 recurse: ; preds = %EntryBlock %arg = sub int %AnArg, 1 ; <...
2005 May 05
3
[LLVMdev] Scheme + LLVM JIT
> So as it stands, one should think of out JIT as something akin to the > early Java JITs: one function at a time and only one compile per > function. This is extremely primative by modern JIT standards, where a > JIT will do profiling, find hot functions and reoptimize them, > reoptimize functions when more information about the call tree is > available, have several levels of
2010 Sep 03
6
[LLVMdev] Why clang inlines with -O3 flag and opt doesn't?
...ll doesn't have any degree of inlining despite the flag -O3. Why clang with the flag -O3 inlines code and opt with the same -O3 doesn't? How can I make opt inline my .ll code the same way? Yuri --- fiobonacci fib.c example --- #include<stdlib.h> #include<stdio.h> int fib(int AnArg) { if (AnArg<= 2) return (1); return (fib(AnArg-1)+fib(AnArg-2)); } int main(int argc, char* argv[]) { int n = atoi(argv[1]); printf("fib(%i)=%i\n", n, fib(n)); } --- my handcrafted fib.ll --- define i32 @fib(i32) nounwind readnone { fib.top: %xcmp1 = icmp ugt i32 %0, 1...
2004 Nov 05
2
[LLVMdev] Re: LLVM Visual Studio Project files
Like I said, it is in my path. That's not enough. I'd be happy if Morten chimed in with any suggestions as to how he got it to work. On Thu, 04 Nov 2004 18:45:18 -0800 Reid Spencer <reid at x10sys.com> wrote: > Two suggestions: > > 1. m4 might be located by your PATH variable. > 2. Talk to Morten Ofstad about how he got it to work. > > Reid. > > On
2017 Apr 08
3
How to insert vector type input parameter for function in C/C++ API?
Fantastic! It's working! Thank you so much Craig!!! On Fri, Apr 7, 2017 at 6:05 PM, Craig Topper <craig.topper at gmail.com> wrote: > It should be VectorType::get(Type::getInt32Ty(Context),4). You need the > word "get" after VectorType:: > > ~Craig > > On Fri, Apr 7, 2017 at 6:01 PM, Michael Choi <choimichael103 at gmail.com> > wrote: >
2009 Aug 31
0
[LLVMdev] problems with the 2.6 branch under x86_64
..."x86_64-apple-darwin"...Reading symbols for shared libraries .... done (gdb) r Starting program: /Users/lrz/src/llvm-26/Release/examples/HowToUseJIT Reading symbols for shared libraries +++. done We just constructed this LLVM module: ; ModuleID = 'test' define i32 @add1(i32 %AnArg) { EntryBlock: %addresult = add i32 1, %AnArg ; <i32> [#uses=1] ret i32 %addresult } define i32 @foo() { EntryBlock: %add1 = tail call i32 @add1(i32 10) ; <i32> [#uses=1] ret i32 %add1 } Running foo: Program received signal EXC_BAD_ACCESS, Cou...
2004 Sep 23
0
[LLVMdev] struct and class under VC7.1
MSVC++ is picky about this. It considers classes and structs to be different types so you have to be consistent. If you forward declared a struct as a class within the same compilation unit, it would complain about that too. It's not just linking. On Thu, 23 Sep 2004 15:59:42 +0200 Paolo Invernizzi <arathorn at fastwebnet.it> wrote: > Hi all, > > Finally I managed to find
2006 Apr 13
0
[LLVMdev] standalone llvm
On Thu, 13 Apr 2006, Simon Burton wrote: > > Is it possible to get llvm to generate native machine code > without using gcc and friends ? Do I use lli ? LLVM only needs llvm-gcc to translate from C/C++ to LLVM IR. If you already have code in LLVM IR form (e.g. because you're generating it on the fly or you have your own front-end) you don't need llvm-gcc. > I'd like to
2006 Apr 13
0
[LLVMdev] Re: standalone llvm
Simon Burton <simon at arrowtheory.com> writes: > I'm trying to take assembly and create machine code I can execute. > How close am I ? Your test case is not complete. Besides, which version of llvm are you using? What are the commands for compiling and linking your test case? How it bombs? Do you #include "llvm/ExecutionEngine/JIT.h" ? -- Oscar