[llvm-dev] Bug 50482 - optimizer malloc

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Wed Nov 17 05:08:23 PST 2021


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


More information about the llvm-dev mailing list