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

Tim Northover t.p.northover at gmail.com
Fri Oct 12 07:59:40 PDT 2012


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.



More information about the llvm-commits mailing list