[llvm-commits] [PATCH] lli memory manager does not ensure proper alignment

Amara Emerson Amara.Emerson at arm.com
Fri Oct 12 08:49:52 PDT 2012


That should do it, test case attached.

Amara

-----Original Message-----
From: Tim Northover [mailto:t.p.northover at gmail.com] 
Sent: 12 October 2012 16:00
To: Amara Emerson
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: [llvm-commits] [PATCH] lli memory manager does not ensure proper alignment

On Fri, Oct 12, 2012 at 2:51 PM, Amara Emerson <amara.emerson at arm.com> wrote:
> Good find. I've attached a new patch that hopefully fixes that issue, it
> uses RoundUpToAlignment() as well.

Some kind of test would also be good. I've had success with a variant of:

@var = global i32 0, align 32
define i32 @main() {
  %addr = ptrtoint i32* @var to i64
  %mask = and i64 %addr, 31
  %tst = icmp eq i64 %mask, 0

  br i1 %tst, label %good, label %bad
good:
  ret i32 0
bad:
  ret i32 1
}

Though I haven't looked into what's needed to make it play nicely with llvm-lit.

Tim.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lli-align-datasection-revised1-testcase.patch
Type: application/octet-stream
Size: 575 bytes
Desc: lli-align-datasection-revised1-testcase.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121012/e61a5200/attachment.obj>


More information about the llvm-commits mailing list