[LLVMdev] Passing pointers to pointers to JIT

Anton Korobeynikov asl at math.spbu.ru
Mon Oct 8 09:13:43 PDT 2007


> What is the proper way of passing multi-dimensional arrays from C/C++ code to 
> LLVM JIT? If someone could let me know what I'm doing wrong and how to get 
> this to work, that'd be great. Or alternatively does anyone have a function 
> that would convert arrays of the form float[n][4] into array of vectors of  
> [n x <4 x float>] format and back?
The question was answered at #llvm. There were two problems:

1. Usage of GEPs ([n x [4 x float]] is not float**)
2. Alignment issues for vector store (aka "stack realignment").

Working code is in http://pastebin.com/m5b341b2e

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.





More information about the llvm-dev mailing list