[PATCH] D66161: [SLC] Dereferenceable annonation - handle valid null pointers
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 13 15:47:56 PDT 2019
jdoerfert added inline comments.
================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:206
CI->removeParamAttr(ArgNo, Attribute::Dereferenceable);
CI->removeParamAttr(ArgNo, Attribute::DereferenceableOrNull);
CI->addParamAttr(ArgNo, Attribute::getWithDereferenceableBytes(
----------------
Now, one could just keep this annotation if `NullPointerIsDefined(F, AS)` was true.
================
Comment at: test/Transforms/InstCombine/mem-deref-bytes-addrspaces.ll:6
+
+define i32 @memcmp_const_size_update_deref8(i8 addrspace(1)* nocapture readonly %d, i8* nocapture readonly %s) "null-pointer-is-valid"="true" {
+; CHECK-LABEL: @memcmp_const_size_update_deref8(
----------------
The point was, ` "null-pointer-is-valid"="true" ` should not be needed if the AS is set to (sth not known to have an invalid null).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66161/new/
https://reviews.llvm.org/D66161
More information about the llvm-commits
mailing list