Something like the following should work:<div><div> %Nx = call i32 @get_local_size(i32 0)</div><div> %Ny = call i32 @get_local_size(i32 1)</div><div> %Nz = call i32 @get_local_size(i32 2)</div><div> %mul1 = mul nuw i32 %Ny, %Nx</div>
<div> %mul2 = mul nuw i32 %Nz, %mul1</div><div> %A = alloca i32, i32 %mul2, align 4</div></div><br><div>On Tue Apr 01 2014 at 4:57:44 PM, Paul Vario <<a href="mailto:paul.paul.mit@gmail.com">paul.paul.mit@gmail.com</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi Fellows,<br><br></div> What's the best way to emit the following code in LLVM APIs:<br>
<br></div> %Nx = call i32 @get_local_size(i32 0)<br> %Ny = call i32 @get_local_size(i32 1)<br>
%Nz = call i32 @get_local_size(i32 2)<br><br></div> %A = alloca [Nx x [ Ny x [Nz x i32]]], align64<br><br></div> It basically allocates a 3D dynamic array, where the 3D sizes are unknown at compile time. I am not sure if using alloca is the right direction? Any other alternatives?<br>
<br></div>Best,<br></div>Paul<br><div><div><div><div><div><div><br></div></div></div></div></div></div></div>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</blockquote>