[all-commits] [llvm/llvm-project] bb206c: [NVPTX] Apply global var demotion to private symbols

qcolombet via All-commits all-commits at lists.llvm.org
Wed Aug 9 05:44:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bb206cb131226c375d0e09251e35a3d75dd3f06f
      https://github.com/llvm/llvm-project/commit/bb206cb131226c375d0e09251e35a3d75dd3f06f
  Author: Quentin Colombet <quentin.colombet at gmail.com>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
    A llvm/test/CodeGen/NVPTX/demote-vars.ll

  Log Message:
  -----------
  [NVPTX] Apply global var demotion to private symbols

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.

Differential Revision: https://reviews.llvm.org/D154507




More information about the All-commits mailing list