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

malloc() always compare different #777

Open
nunoplopes opened this issue Feb 25, 2022 · 2 comments
Open

malloc() always compare different #777

nunoplopes opened this issue Feb 25, 2022 · 2 comments
Labels
memory Memory Model

Comments

@nunoplopes
Copy link
Member

see this:

define i1 @two_nonnull_mallocs() {
%0:
  %m = malloc i64 4
  %n = malloc i64 4
  %cmp = icmp eq * %m, %n
  ret i1 %cmp
}
=>
define i1 @two_nonnull_mallocs() {
%0:
  ret i1 0
}
Transformation seems to be correct!

We ignore the fact that malloc() may return null. LLVM seems to be going into a stricter direction. We need to reevaluate and test if a stricter memory model & refinement criteria makes sense now.

@nunoplopes
Copy link
Member Author

Related with #732

@nunoplopes nunoplopes added the memory Memory Model label Feb 25, 2022
@aqjune
Copy link
Member

aqjune commented Feb 26, 2022

For this case only, tgt has no allocation - so we can individually assign nonnull-ness to each malloc.

To correctly deal with this issue, I think we need a mapping between allocations in src and tgt.
For the mapped blocks, the nonnull-ness must be equivalent.

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

2 participants