Andrew,
are you using 2.9 ?, I had trouble with GEP on
arrays in 2.8, until I upgraded
and then the problem went away.
-Peter Lawrence.
On Jul 25, 2011, at 6:43 AM, llvmdev-request at cs.uiuc.edu wrote:
> ------------------------------
>
> Message: 7
> Date: Mon, 25 Jul 2011 13:44:50 +1200
> From: Andrew Ferguson <andrewf at idlearts.com>
> Subject: [LLVMdev] function failing to run in Jit
> To: llvm <llvmdev at cs.uiuc.edu>
> Message-ID: <1311558290.2261.83.camel at andrew-desktop>
> Content-Type: text/plain; charset="UTF-8"
>
> Is there any reason this generated code won't run in the Jit?
> I've pretty much got everything else working for my front end
> which all runs fin in the Jit but I can't get global arrays to work.
>
> ; ModuleID = 'test'
> target datalayout >
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-
> f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
> target triple = "i686-pc-linux-gnu"
>
> @MyArray = external global [1000 x i32]
>
> define i32 @foo(i32 %a, i32 %b) {
> Entry:
> %mul = mul i32 %b, %a
> %ptr = getelementptr inbounds [1000 x i32]* @MyArray, i32 0, i32 %a
> store i32 %mul, i32* %ptr, align 4
> ret i32 %a
> }
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20110726/089f1f84/attachment.html>