[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 11:56:46 PDT 2018


hfinkel added a comment.

In https://reviews.llvm.org/D52164#1237112, @xbolva00 wrote:

> int f(int n) {
>
>   int *x = (int *)malloc(n);
>   free(x);
>   int *y =  (int *)malloc(n);
>   return (y == x) ;
>
> }
>
> This has been already folded to true even before this patch.


You need to look at how this folding happens? Does it still happen if you actually use the allocation for something? We fold unused allocations away, as I recall.


Repository:
  rL LLVM

https://reviews.llvm.org/D52164





More information about the llvm-commits mailing list