[PATCH] D153949: [Attributor] Convert test to opaque pointers (NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 01:15:22 PDT 2023


nikic added a comment.

Highlighted the relevant differences.



================
Comment at: llvm/test/Transforms/Attributor/nocapture-2.ll:169
+; TUNIT-LABEL: define noundef dereferenceable_or_null(4) ptr @scc_A
+; TUNIT-SAME: (ptr nofree noundef readnone returned dereferenceable_or_null(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2:[0-9]+]] {
 ; TUNIT-NEXT:  entry:
----------------
We get more `returned` due to missing bitcasts -- expected.


================
Comment at: llvm/test/Transforms/Attributor/nocapture-2.ll:176
+; TUNIT-NEXT:    [[CALL1:%.*]] = call noundef dereferenceable_or_null(8) ptr @scc_B(ptr noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A]]) #[[ATTR9]]
+; TUNIT-NEXT:    [[CALL2:%.*]] = call ptr @scc_A(ptr noalias nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A]]) #[[ATTR9]]
 ; TUNIT-NEXT:    br label [[COND_END:%.*]]
----------------
We lost `dereferenceable_or_null` on `@scc_A` calls -- it's still present on the declaration though, so no real loss of information. Probably not supposed to happen though?


================
Comment at: llvm/test/Transforms/Attributor/nocapture-2.ll:222
 ; CHECK: Function Attrs: nofree nosync nounwind memory(none)
-; CHECK-LABEL: define dereferenceable_or_null(4) i64* @scc_B
-; CHECK-SAME: (double* nofree noundef readnone dereferenceable_or_null(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2:[0-9]+]] {
+; CHECK-LABEL: define noundef dereferenceable_or_null(8) ptr @scc_B
+; CHECK-SAME: (ptr nofree noundef readnone returned dereferenceable_or_null(8) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR2:[0-9]+]] {
----------------
dereferenceable_or_null increase to 8 is correct, because we now recognize that we return the argument, which has a `dereferenceable_or_null(8)` attribute.


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

https://reviews.llvm.org/D153949



More information about the llvm-commits mailing list