[PATCH] D109337: [GlobalOpt][FIX] Do not embed initializers into AS!=0 globals

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 8 15:19:20 PDT 2021


tra accepted this revision.
tra added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h:52
+  bool canHaveNonUndefGlobalInitializerInAddressSpace(unsigned AS) const {
+    return AS != AddressSpace::ADDRESS_SPACE_SHARED &&
+           AS != AddressSpace::ADDRESS_SPACE_LOCAL && AS != ADDRESS_SPACE_PARAM;
----------------
Nit: Making it a switch and enumerating all known AS would make it harder to give a wrong answer if/when a new AS is added.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109337



More information about the llvm-commits mailing list