Displaying 20 results from an estimated 100 matches similar to: "[LLVMdev] Ocaml JIT example"
2007 Nov 25
2
[LLVMdev] Fibonacci example in OCaml
Here's my translation of the Fibonacci example into OCaml:
open Printf
open Llvm
let build_fib m =
let fibf =
define_function "fib" (function_type i32_type [| i32_type |]) m in
let bb = builder_at_end (entry_block fibf) in
let one = const_int i32_type 1 and two = const_int i32_type 2 in
let argx = param fibf 0 in
set_value_name "AnArg" argx;
let
2007 Oct 02
2
[LLVMdev] OCaml Install Error
On 2007-10-02, at 10:46, Jan Rehders wrote:
> where can I read more about this? I assume (hope) the lib provides
> some kind of OCaml bindings? I could not find any trace of it in
> the 2.1 release source so I guess it's currently SVN only?
Jan,
Here's a trivial example.
$ cat metahelloworld.ml
(* metahelloworld.ml *)
open Llvm
open Llvm_bitwriter
let _ =
let filename
2007 Oct 19
0
[LLVMdev] OCaml Install Error
Hi,
this looks very promising. Do you have any plans to add bindings for
the use of an ExecutionEngine, especially recompileAndRelinkFunction?
I've build an interactive toplevel implemented in OCaml and I have to
pull of some stunts to be able to change the definition of a
function. (emit a .ll file containing the code, looking up the
function and calling removeBody, then reading
2007 Nov 25
5
[LLVMdev] OCaml
On Sunday 25 November 2007 12:23, Gordon Henriksen wrote:
> On 2007-11-24, at 21:58, Jon Harrop wrote:
> > - Garbage collection tuned for functional programming
>
> http://llvm.org/docs/GarbageCollection.html
>
> I've been doing some interesting work on this front. Getting Lattner-
> cycles to have it reviewed and integrated is probably the biggest
> challenge; LLVM
2007 Nov 26
1
[LLVMdev] How to declare and use sprintf
On Monday 26 November 2007 00:40, Gordon Henriksen wrote:
> The type you want is:
>
> let sp = pointer_type i8_type in
> var_arg_function_type sp [| sp; sp |]
Awesome stuff. Here is my most elegant Fibonacci example in OCaml so far:
open Llvm
let ( |> ) x f = f x
let int n = const_int i32_type n
let return b x = build_ret x b |> ignore
let build_fib m =
let ty =
2007 Nov 26
0
[LLVMdev] Fibonacci example in OCaml
Here is a complete 104-line native code compiler for a tiny subset of OCaml
that is expressive enough to compile an external Fibonacci program:
type expr =
| Int of int
| Var of string
| BinOp of [ `Add | `Sub | `Leq ] * expr * expr
| If of expr * expr * expr
| Apply of expr * expr
type defn =
| LetRec of string * string * expr
open Camlp4.PreCast;;
let expr = Gram.Entry.mk
2007 Nov 25
2
[LLVMdev] How to declare and use sprintf
So my Fib program is segfaulting and I'm not sure why. I think it might be
because my declaration and use of sprintf is wrong.
I notice llvm-gcc produces declarations containing "..." like:
declare int %printf(sbyte*, ...)
but I'm not sure how to do this so I've used:
let sprintf =
declare_function "sprintf"
(function_type (pointer_type
2007 Oct 02
0
[LLVMdev] OCaml Install Error
Hi,
where can I read more about this? I assume (hope) the lib provides
some kind of OCaml bindings? I could not find any trace of it in the
2.1 release source so I guess it's currently SVN only?
greetings,
Jan
On 2. Okt 2007, at 12:22, Gordon Henriksen wrote:
> On 2007-10-02, at 03:19, Gordon Henriksen wrote:
>
>> On Oct 2, 2007, at 00:17, Bill Wendling wrote:
>>
2007 Oct 02
4
[LLVMdev] OCaml Install Error
On 2007-10-02, at 03:19, Gordon Henriksen wrote:
> On Oct 2, 2007, at 00:17, Bill Wendling wrote:
>
>> I get this error duing a "make install":
>>
>> llvm[3]: Installing Debug /usr/local/lib/ocaml/libllvm.a
>> install: /usr/local/lib/ocaml/libllvm.a: Permission denied
>> make[3]: *** [install-a] Error 71
>> make[2]: *** [install] Error 1
2014 Jan 25
0
[klibc:master] auxv: convert auxiliary vector into an array; define getauxval()
Commit-ID: 45e09deb6a0a4fcb3a56efb7e18807b2800e358f
Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=45e09deb6a0a4fcb3a56efb7e18807b2800e358f
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Fri, 24 Jan 2014 20:26:04 -0800
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Fri, 24 Jan 2014 20:28:23 -0800
auxv: convert auxiliary vector into an
2007 Nov 25
0
[LLVMdev] OCaml
Jon,
On 2007-11-24, at 21:58, Jon Harrop wrote:
> I just took another look at the LLVM project and it has come along
> in leaps and bounds since I last looked. I've been working through
> the (awesome!) tutorial and am now really hyped about the project.
Excellent!
> I am particularly interested in using LLVM to write compilers for
> OCaml-like languages in OCaml-like
2018 Jan 09
2
Passing Array base address/pointer to runtime function in LLVM IR
Hello LLVM,
I am a beginner in LLVM
My Goal is to initialize array element with random values.
llvm::Type *i32_type = llvm::IntegerType::getInt32Ty(allocaInst->getContext());
llvm::Value *value = llvm::ConstantInt::get(i32_type, numberOfElement);
args.push_back(getElementPtrInst->getPointerOperand());
args.push_back(value);
callInst =
2007 Nov 25
9
[LLVMdev] OCaml
Hi!
I just took another look at the LLVM project and it has come along in leaps
and bounds since I last looked. I've been working through the (awesome!)
tutorial and am now really hyped about the project.
I am particularly interested in using LLVM to write compilers for OCaml-like
languages in OCaml-like languages. This requires some core functionality that
would be generically useful:
2007 Nov 27
1
[LLVMdev] Fibonacci example in OCaml
On 2007-11-26, at 21:12, Jon Harrop wrote:
> Provide a type enumerating the valid terminators and restrict the
> last instruction in a block to be a terminator. Something like this:
>
> type terminator = [ `ret of llvalue | `br of llvalue ]
> type instruction =
> [ terminator
> | `add of llvalue * llvalue
> | `sub of llvalue * llvalue ]
> type block
2007 Nov 27
0
[LLVMdev] Fibonacci example in OCaml
On Monday 26 November 2007 20:05, Gordon Henriksen wrote:
> On Nov 26, 2007, at 14:18, Jon Harrop wrote:
> > On Monday 26 November 2007 16:21, Gordon Henriksen wrote:
> >> Unfortunately, even if the bindings were more strongly typed, it
> >> would still be structurally possible to build invalid LLVM code, so
> >> you've just got to take care not to violate
2009 Feb 19
6
[LLVMdev] Improving performance with optimization passes
I'm toying with benchmarks on my HLVM and am unable to get any performance
improvement from optimization passes. Moreover, some of my programs generate
a lot of redundant code (e.g. alloca a struct, store a struct into it and
read only one field without using the rest of the struct) and this does not
appear to be optimized away.
I simply copied the use of PassManager from the Kaleidoscope
2007 Sep 14
0
[LLVMdev] C interface
Hello Gordon,
I'm part of the felix dev team, and I've been interested in making a
backend for felix in llvm. It's very exciting to hear that you're making
an ocaml interface to llvm. Do you have any of the libraries exposed to
the public yet? Also, what license do you plan on using for the code?
Felix is bsd, like llvm, so if there's any chance that you'll use a
2007 Nov 26
0
[LLVMdev] How to declare and use sprintf
On Nov 25, 2007, at 18:53, Jon Harrop wrote:
> So my Fib program is segfaulting and I'm not sure why. I think it
> might be because my declaration and use of sprintf is wrong.
>
> I notice llvm-gcc produces declarations containing "..." like:
>
> declare int %printf(sbyte*, ...)
>
> What is the correct way to do this?
The type you want is:
let sp =
2007 Sep 12
7
[LLVMdev] C interface
Hi all,
I'm authoring a C interface to the LLVM IR type system. Since this is
Really Quite Tedious, I would like to solicit opinions before I get
too far down any paths that seem offensive. I've attached the header,
where I've mapped a portion of Module and most of Type and its
subclasses. This is working, and I've built ocaml bindings on top of
it.[1] My intent is to
2014 Oct 02
3
[LLVMdev] How do I update Ocaml debug info? (was Re: [llvm] r218914 - DI: Fold constant arguments into a single MDString)
-llvm-commits, +llvmdev
> On Oct 2, 2014, at 2:57 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>
> Author: dexonsmith
> Date: Thu Oct 2 16:56:57 2014
> New Revision: 218914
>
> URL: http://llvm.org/viewvc/llvm-project?rev=218914&view=rev
> Log:
> DI: Fold constant arguments into a single MDString
>
> This patch addresses the first