Octave's JIT compiler vs. LLVM in MXE Octave

The version of LLVM that we use in MXE Octave is pretty old. We currently build LLVM 7.1.0 which was released in May 2019.
The current release of LLVM is 11.0.0.

There is no specific issue that I want to resolve by potentially updating to a newer version. It is more like I don’t know whether it is a good idea to rely on old, no longer supported versions of software.

Octave’s JIT compiler has LLVM as a dependency (but also Mesa’s llvmpipe which we use as a software OpenGL renderer).
IIUC, that JIT compiler only (kind of) works with specific versions of LLVM. IIRC, the last version that it could be used with was LLVM 6.
I’m assuming that updating the JIT compiler will be more and more difficult the more versions of LLVM we advance.

Does that mean we should refrain from updating LLVM in MXE Octave any further?
Or is it ok to “give up” on the JIT compiler for the time being? At least when it comes to building Octave with MXE Octave (i.e. mainly for Windows).

Any opinions or insight on potential work on Octave’s JIT compiler?

The JIT compiler in Octave doesn’t do anything useful at this point.

Also, we don’t enable the JIT compiler for the Windows builds of Octave so it doesn’t matter if the version of LLVM in mxe-octave will work with Octave’s JIT compiler. It’s more important that it works well with the Mesa package, so if updating LLVM will help there, then go ahead and do it if you would like.

And one of the annoying things with trying to maintain the JIT compiler was that LLVM kept changing their API every release. It became too much trouble to follow LLVM and recode Octave every 6 months to match their new API. So, if upgrading LLVM just works with MESA then it is probably okay. Otherwise, what we have works and we should leave it alone.

I updated to LLVM 8 in this changeset:

It might be worthwhile to update one more version to LLVM 9.
There was no bug report about this yet. But the following bug that was fixed upstream in that version might help us to prevent issues with exception handling on 32 bit Windows:
LLVM 9.0.0 Release Notes:

  • Fixed a bug in generating DWARF unwind information for 32 bit MinGW

Additionally, that version is the first to build correctly with Python 3 IIUC. That means we could reduce the number of packages that depend on (the discontinued) Python 2.

llvm 11 was released on oct 12

I was trying to update in incremental steps and check if something breaks at some point on the way. I’m currently testing version 9.0.1.
Also, it looks like they usually make a dot release a few months after a major release with fixes for bugs found in the new version. It might make sense to wait for that.

I pushed a patch here to update LLVM to 9.0.1:
mxe-octave: 1a766822f3ac

Mesa seems to be much more resilient to being compiled with different versions of LLVM than Octave’s JIT compiler. They either use a lot of #ifdefs or they use a more stable API than the one used by Octave…