[PATCH] D45344: [InstCombine] Fold malloc + memset to calloc even for llvm.memset

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 14:49:09 PDT 2018


spatel added a comment.

I'm confused. This patch is supposed to show a calloc transform.

@malloc_and_memset_intrinsic has multiple uses of the malloc result, so the transform doesn't work there. Is there some other way to show the transform? If not, then sorry that I misunderstood, but we can't split the patches.

But https://reviews.llvm.org/D45381 just removes the one-use check and miscompiles @buffer_is_modified_then_memset. Why is that ok?


https://reviews.llvm.org/D45344





More information about the llvm-commits mailing list