[PATCH] D154507: [NVPTX] Apply global var demotion to private symbols

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 06:22:56 PDT 2023


qcolombet created this revision.
qcolombet added reviewers: jholewinski, tra, guraypp.
Herald added subscribers: mattd, gchakrabarti, asavonic, hiraditya.
Herald added a project: All.
qcolombet requested review of this revision.
Herald added a subscriber: wangpc.
Herald added a project: LLVM.

When emitting the assembly we perform some late global variables demotion.
Prior to this patch, this optimization was only performed on variables with
the `internal` linkage whereas any local global variable can be demoted.

Fix that by using `hasLocalLinkage` instead of `hasInternalLinkage`.

Without this change, global variables with the `private` linkage wouldn't
be demoted.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154507

Files:
  llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  llvm/test/CodeGen/NVPTX/demote-vars.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154507.537333.patch
Type: text/x-patch
Size: 4326 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230705/03bbf189/attachment.bin>


More information about the llvm-commits mailing list