[all-commits] [llvm/llvm-project] 3b8539: [NVPTX] use incomplete aggregate initializers (#79...

Alex MacLean via All-commits all-commits at lists.llvm.org
Wed Jan 24 09:24:41 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3b8539c9dc0bc38ebea903e038257ed4328f290b
      https://github.com/llvm/llvm-project/commit/3b8539c9dc0bc38ebea903e038257ed4328f290b
  Author: Alex MacLean <amaclean at nvidia.com>
  Date:   2024-01-24 (Wed, 24 Jan 2024)

  Changed paths:
    M llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
    A llvm/test/CodeGen/NVPTX/global-incomplete-init.ll
    M llvm/test/CodeGen/NVPTX/globals_init.ll
    M llvm/test/CodeGen/NVPTX/i128-global.ll

  Log Message:
  -----------
  [NVPTX] use incomplete aggregate initializers (#79062)

The PTX ISA specifies that initializers may be incomplete ([5.4.4.
Initializers](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#initializers))
> As in C, array initializers may be incomplete, i.e., the number of
initializer elements may be less than the extent of the corresponding
array dimension, with remaining array locations initialized to the
default value for the specified array type.

Emitting initializers in this form is preferable because it reduces the
size of the PTX, in some cases significantly, and can improve compile
time of ptxas as a result.




More information about the All-commits mailing list