[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:41:55 PDT 2021
tra added inline comments.
================
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;
----------------
jdoerfert wrote:
> tra wrote:
> > 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.
> >
> >
> The AMD enum has dozens of members :( and we already do these checks in other places. I'd leave it like this for now if it's ok.
OK. This is fine, too.
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