[llvm-dev] Bug 50482 - optimizer malloc
Victor Yodaiken via llvm-dev
llvm-dev at lists.llvm.org
Wed Nov 17 06:05:00 PST 2021
But in this case, we are not removing a malloc/free pair that does not leak
information because the side effect determines the return value.
On Wed, Nov 17, 2021 at 7:08 AM Joerg Sonnenberger via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> On Tue, Nov 16, 2021 at 09:18:09PM -0600, Victor Yodaiken via llvm-dev
> wrote:
> > What exactly is being optimized here? Does program performance improve?
>
> Consider a program that allocates memory, computes something in it and
> frees the memory. If the computation can be done at compile time and all
> stores are removed by Dead Store Elimination and the address doesn't
> otherwise leak, the program can be reduced to malloc + free (or
> new+delete). That makes it very beneficial to be able to remove the
> allocation pair as well.
>
> Joerg
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211117/ef5d5514/attachment.html>
More information about the llvm-dev
mailing list