[PATCH] D70789: [Attributor] Remove dereferenceable_or_null when nonull is present

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 11:23:24 PST 2019


jdoerfert added a comment.

This was a problem for a while now:
Can we have a test case to make sure we do not lose information, e.g. `deref_or_null(100) nonnull deref(4)` should not remove the `deref_or_null(100)`.



================
Comment at: llvm/test/Transforms/FunctionAttrs/dereferenceable.ll:33
 define i32* @test3_2(i32* dereferenceable_or_null(32) %0) local_unnamed_addr {
 ; FIXME: We should not have both deref(x) and deref_or_null(y) with x >= y.
+; ATTRIBUTOR: define nonnull dereferenceable(16) i32* @test3_2(i32* nofree nonnull readnone dereferenceable(32) "no-capture-maybe-returned" %0)
----------------
FIXME can be removed.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70789/new/

https://reviews.llvm.org/D70789





More information about the llvm-commits mailing list