Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Possible workaround for unsupported nested structs #993
This is a problem when working with NumPy arrays, because AFAIU, an array is stored in a struct like
I can get around the issue by manually editing the LLVM IR, replacing e.g.:
This is equivalent to the original statement, but it makes emscripten happier.
Until the bug is fixed in PNaCl, what should I tweak in Numba's LLVM code generation to implement this change?
That particular pattern seems to be generated as part of an optimisation pass, rather than anything emitted explicitly by Numba - if you run with
One possible workaround is to set
At a guess, I think the instruction combining pass might be responsible for making this transformation - I'm not sure if there are ways to switch on and off specific passes from within Numba, but someone else may be able to shed more light on this.
I'm testing this on:
@jit(int32(int32[:]), nopython=True) def f(x): return x + x
I'll see if emscripten works with
OK without optimization I have another error message with emscripten:
This time I'm not sure what's happening...
Here is the code just before that failing instruction (same function example
That's also what I thought. I originally tested with the latest stable version, which uses LLVM 3.4 as far as I can tell. Then I updated to WIP branches with LLVM 3.5, and I got the same problems.
FWIW I've found a similar bug report here: http://code.google.com/p/nativeclient/issues/detail?id=3932
I'm wondering whether this would be better solved in Numba or in emscripten/PNaCl. I've sent an e-mail to the emscripten mailing list: https://groups.google.com/forum/#!topic/emscripten-discuss/eWwyFw-YYPo
I got around these two problems with
I'll let you know once I have something working...