[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-patch-tracker] [patch #8395] Work-in-progress port of Octave JIT
From: |
David Malcolm |
Subject: |
[Octave-patch-tracker] [patch #8395] Work-in-progress port of Octave JIT to libgccjit |
Date: |
Fri, 14 Mar 2014 22:52:30 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22 |
URL:
<http://savannah.gnu.org/patch/?8395>
Summary: Work-in-progress port of Octave JIT to libgccjit
Project: GNU Octave
Submitted by: dmalcolm
Submitted on: Fri 14 Mar 2014 10:52:30 PM GMT
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
I've been experimentally porting Octave's existing JIT to libgccjit:
http://gcc.gnu.org/wiki/JIT
I thought it was time I posted what I have. It compiles and runs, though
there are plenty of issues.
Notes:
* I split out HAVE_LLVM to HAVE_JIT, HAVE_LLVM, and HAVE_GCCJIT
* both the LLVM *and* gccjit implementations are built within the same
build. This is clearly overkill, but is handy for debugging in that
one can compare what each of the two implementation produces.
The resulting preprocessor gunk is deeply ugly. Perhaps it could be
simplified by making choice of JIT backend be a configure-time thing,
rather than trying to support both within one process.
* jit.tst runs, but I had to hack out some of the tests for now. It
tries to run both the LLVM and gccjit compiler on the IR. It then
tries to run the gccjit-built code, if that succeeded; failing that
the LLVM-built code.
It fails near the end here:
jit fail: Too many parameter to function
***** testif HAVE_JIT
jit_failure_count (0)
assert (id (1), 1);
assert (id (1+1i), 1+1i);
assert (id (1, 2), 1);
assert (jit_failure_count, 0);
!!!!! test failed
ASSERT errors for: assert (jit_failure_count,0)
in type-inference on the id (1, 2) I believe, before my code; do other
people see this?
* I've only implemented JIT-compilation of loops for now, not functions.
I hope the latter is fairly easy to add, but I wanted to post
something.
* lots of FIXMEs, TODOs and other cruft; sorry (e.g. the configure.ac
"test", which for now just hardcodes a location of a libgccjit
checkout)
* libgccjit currently requires function names to be valid C
identifiers, so I changed some functions to obey this restriction
* there's a name-mangling issue with gripe_divide_by_zero, which for me
gets name-mangled by the C++ compiler (to "_Z20gripe_divide_by_zerov").
For now I have a horrible hack I'm applying on the libgccjit side which
special-cases this, and applies the mangling when referencing this
symbol (am attaching it)
Clearly this isn't ready yet, but I wanted some feedback from the Octave
maintainers on the direction of this.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 14 Mar 2014 10:52:30 PM GMT Name:
port-of-octave-jit-to-libgccjit.patch Size: 121kB By: dmalcolm
Work-in-progress port of Octave JIT to libgccjit (patch against
"default")
<http://savannah.gnu.org/patch/download.php?file_id=30906>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?8395>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-patch-tracker] [patch #8395] Work-in-progress port of Octave JIT to libgccjit,
David Malcolm <=