Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alloc of > half of address space is complicated #754

Open
nunoplopes opened this issue Oct 13, 2021 · 0 comments
Open

Alloc of > half of address space is complicated #754

nunoplopes opened this issue Oct 13, 2021 · 0 comments
Labels
memory Memory Model

Comments

@nunoplopes
Copy link
Member

nunoplopes commented Oct 13, 2021

LLVM does this (from @regehr):

define i1 @fn(i64 %x) {
  %m = malloc i64 %x
  %cmp = icmp eq * %m, null, use_provenance
  ret i1 %cmp
}
=>
define i1 @fn(i64 %x) {
  ret i1 0
}
Transformation doesn't verify!

ERROR: Value mismatch

Example:
i64 %x = #x8000000000000000 (9223372036854775808, -9223372036854775808)

Source:
* %m = null
i1 %cmp = #x1 (1)

Target:
Source value: #x1 (1)
Target value: #x0 (0)

Considering that LLVM sign-extends offsets in GEPs and etc, can we support such large allocations? How does the inbounds check looks like then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory Memory Model
Projects
None yet
Development

No branches or pull requests

1 participant