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

Luqman Aden via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 17:34:32 PST 2016


luqmana added a comment.

In https://reviews.llvm.org/D27114#628254, @efriedma wrote:

> I don't think there's any existing analysis which computes the sort of post-dominator tree you want.
>
> Anyway, I'm not sure this is really what you want... have you experimented with inserting llvm.assume calls?


The problem wasn't that. We do have llvm.assume which InstCombine turns `assume( (load addr) != null )` to a `load addr !nonnull`. Then, SROA/mem2reg end up eating the !nonnull metadata.

Some more details at https://github.com/rust-lang/rust/issues/37945 which was linked in the bug link in the description.


https://reviews.llvm.org/D27114





More information about the llvm-commits mailing list