[PATCH] D109337: [GlobalOpt][FIX] Do not embed initializers into AS!=0 globals
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 8 15:37:30 PDT 2021
jdoerfert 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;
----------------
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.
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