[PATCH] D27114: Preserve nonnull metadata on Loads through SROA & mem2reg.
Chandler Carruth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 21 18:18:16 PST 2016
chandlerc added a comment.
In https://reviews.llvm.org/D27114#628901, @efriedma wrote:
> > 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.
>
> You can do the reverse transform in mem2reg: load addr !nonnull -> assume( (load addr) != null ), then when the load gets erased the nonnull assumption is preserved.
Or we could stop instcombine from doing this in the first place.
I think we should canonicalize on the assume formulation as it is strictly more general than the nonnull metadata formulation.
https://reviews.llvm.org/D27114
More information about the llvm-commits
mailing list