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

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 16:24:18 PST 2017


hfinkel added inline comments.


================
Comment at: lib/Transforms/Utils/PromoteMemoryToRegister.cpp:408
+    if (AC && LI->getMetadata(LLVMContext::MD_nonnull))
+      addAssumeNonNull(AC, LI);
+
----------------
Even if we're going to do this in general, we shouldn't do this when we can otherwise prove that the address was nonnull. Can you call isKnownNonNullAt and only add the intrinsic when we need it?

The same applies to other places where you call addAssumeNonNull.



https://reviews.llvm.org/D27114





More information about the llvm-commits mailing list