<div dir="ltr">But in this case, we are not removing a malloc/free pair that does not leak<div>information because the side effect determines the return value.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 17, 2021 at 7:08 AM Joerg Sonnenberger via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Nov 16, 2021 at 09:18:09PM -0600, Victor Yodaiken via llvm-dev wrote:<br>
> What exactly is being optimized here? Does program performance improve?<br>
<br>
Consider a program that allocates memory, computes something in it and<br>
frees the memory. If the computation can be done at compile time and all<br>
stores are removed by Dead Store Elimination and the address doesn't<br>
otherwise leak, the program can be reduced to malloc + free (or<br>
new+delete). That makes it very beneficial to be able to remove the<br>
allocation pair as well. <br>
<br>
Joerg<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>