[PATCH] D53342: [SimplifyLibCalls] Mark known arguments with nonnull
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 20 11:53:37 PDT 2019
jdoerfert added inline comments.
================
Comment at: test/Transforms/InstCombine/mem-deref-bytes.ll:76
+define i32 @memcmp_const_size_update_deref7(i8* nocapture readonly %d, i8* nocapture readonly %s) "null-pointer-is-valid"="true" {
+; CHECK-LABEL: @memcmp_const_size_update_deref7(
----------------
xbolva00 wrote:
> @jdoerfert please check this "side-effect" improvement while working on nonnull annotation..
>
> if "null-pointer-is-valid"="true" and "nonnull dereferenceable_or_null(40)" -> nonnull dereferenceable(40) is ok?
>
> if nonnull is missing, see memcmp_const_size_update_deref6,
>
> See newly added "CI->paramHasAttr(ArgNo, Attribute::NonNull) check" in annotateDereferenceableBytes.
This looks fine to me, also test6. `nonnull` + `dereferenceable_or_null(X)` is always `dereferenceable(X)` regardless of the validity of null.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D53342/new/
https://reviews.llvm.org/D53342
More information about the llvm-commits
mailing list