[PATCH] D52164: [InstSimplify] Fold ne/eq comparison of a pointer produced by a noalias function
Hal Finkel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 17 10:53:10 PDT 2018
hfinkel requested changes to this revision.
hfinkel added a comment.
This revision now requires changes to proceed.
Unfortunately, I don't think that we can do this. noalias semantics only provide information about the overlap of memory accesses using the resulting pointers, in the context of other necessary constraints, and does not strongly constrain the pointer values. For example, it might be that:
int *x = malloc(n);
free(x);
int *y = malloc(n);
if (y == x) // should we always fold this to false?
printf("malloc reused memory");
Also, what happens if the result is null, and you're comparing to a value which also happens to be null?
Repository:
rL LLVM
https://reviews.llvm.org/D52164
More information about the llvm-commits
mailing list