[PATCH] D27114: Preserve nonnull metadata on Loads through SROA & mem2reg.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 05:46:12 PST 2017


hfinkel added a comment.

In https://reviews.llvm.org/D27114#636391, @chandlerc wrote:

> In https://reviews.llvm.org/D27114#636348, @spatel wrote:
>
> > Thanks for the changes.
> >
> > Someone else can correct me if I'm wrong, but I think we're delaying improvements in nonnull optimization until we have a clang hack to avoid disastrous optimizations of libc functions:
> >  http://lists.llvm.org/pipermail/cfe-dev/2017-January/052066.html
>
>
> Yes, that thread seems largely in favor of getting something in place in Clang first.
>
> If no one else works on a patch to Clang I may in a week or so, but sadly my queue is very full at the moment.


I don't think that's relevant to this patch. Once we have the nonnull in metadata form, we should preserve it. The particular problem with optimizing based on nonnull function-argument annotations is propagating the nonnull annotation from a callsite back into the caller. For that, we should wait on associated Clang updates (so that we can avoid doing it for memcpy and friends based on header-file annotations). This change should proceed.


https://reviews.llvm.org/D27114





More information about the llvm-commits mailing list