[PATCH] D45344: [SimplifyLibcalls] Fold malloc + memset to calloc even for llvm.memset
Dávid Bolvanský via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 7 04:59:02 PDT 2018
xbolva00 added a comment.
In https://reviews.llvm.org/D45344#1060345, @spatel wrote:
> 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?
I closed https://reviews.llvm.org/D45381 & reupdated this patch, added test case. Test @buffer_is_modified_then_memset is ok now too.
https://reviews.llvm.org/D45344
More information about the llvm-commits
mailing list