[all-commits] [llvm/llvm-project] 9affa1: [NVPTX] Add support for calling aliases (#81170)

Alex MacLean via All-commits all-commits at lists.llvm.org
Thu Feb 8 15:14:25 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9affa177b526459beddafad30474d2e3186376e4
      https://github.com/llvm/llvm-project/commit/9affa177b526459beddafad30474d2e3186376e4
  Author: Alex MacLean <amaclean at nvidia.com>
  Date:   2024-02-08 (Thu, 08 Feb 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/AsmPrinter.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
    M llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h
    M llvm/test/CodeGen/NVPTX/alias.ll

  Log Message:
  -----------
  [NVPTX] Add support for calling aliases (#81170)

The current implementation of aliases tries to remove all the aliases in
the module to prevent the generic version of `AsmPrinter` from emitting
them incorrectly. Unfortunately, if the aliases are used this will fail.
Instead let's override the function to print aliases directly.

In addition, the declarations of the alias functions must occur before
the uses. To fix this we emit alias declarations as part of
`emitDeclarations` and only emit the `.alias` directives at the end
(where we can assume the aliasee has also already been declared).




More information about the All-commits mailing list