[PATCH] D98783: [AMDGPU] Add GlobalDCE before internalization pass

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 15 12:56:16 PDT 2021


tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.

LGTM with a test nit.



================
Comment at: clang/test/CodeGenCUDA/unused-global-var.cu:23-29
+// CHECK-NOT: @_ZL2v3
+constexpr int v3 = 1;
+
+// Check managed variables are always kept.
+
+// CHECK: @v4
+__managed__ int v4;
----------------
Mixing CHECK and CHECK-NOT is tricky and, in general, only works if things are always in the same order.

E.g. if does `v3` get emitted after  `v4`, the test will still pass.

One way to deal with that would be to split the positive and negative checks into separate runs.
First one would check the variables we do want to keep with `CHECK-DAG`.
The other one would only check for the absence of the variables with `-NOT`.


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

https://reviews.llvm.org/D98783



More information about the cfe-commits mailing list