[all-commits] [llvm/llvm-project] 701d72: [NVPTX] Improve NVVMReflect Efficiency (#134416)

Yonah Goldberg via All-commits all-commits at lists.llvm.org
Thu Apr 10 18:33:59 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 701d726ef09ea89909df9bd2fdc63c63758fe8d6
      https://github.com/llvm/llvm-project/commit/701d726ef09ea89909df9bd2fdc63c63758fe8d6
  Author: Yonah Goldberg <ygoldberg at nvidia.com>
  Date:   2025-04-10 (Thu, 10 Apr 2025)

  Changed paths:
    M clang/test/CodeGen/builtins-nvptx.c
    M llvm/lib/Target/NVPTX/NVPTX.h
    M llvm/lib/Target/NVPTX/NVPTXPassRegistry.def
    M llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp
    M llvm/lib/Target/NVPTX/NVVMReflect.cpp
    A llvm/test/CodeGen/NVPTX/nvvm-reflect-options.ll

  Log Message:
  -----------
  [NVPTX] Improve NVVMReflect Efficiency (#134416)

The NVVMReflect pass simply replaces calls to nvvm-reflect functions
with the appropriate constant, either the architecture number, or
nvvm-reflect-ftz, found in the module's metadata.

The implementation is inefficient and does this by traversing through
all instructions to find calls. The common case is that you never call
nvvm-reflect, so this traversal is costly.

This PR:
- Updates the pass so that it finds the reflect functions by name, and
then traverses through their uses to find the calls directly.
- Adds a line (245) to make sure the dead nvvm-reflect definitions are
erased.
- Adds the ability to set reflect values via command line



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list