[all-commits] [llvm/llvm-project] c38fa7: [NVPTX] Fix pointer type for short 32-bit pointers

Andrew Savonichev via All-commits all-commits at lists.llvm.org
Tue Nov 15 10:52:57 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c38fa7c01403a8116b12d719e977acfc61417041
      https://github.com/llvm/llvm-project/commit/c38fa7c01403a8116b12d719e977acfc61417041
  Author: Andrew Savonichev <andrew.savonichev at gmail.com>
  Date:   2022-11-15 (Tue, 15 Nov 2022)

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

  Log Message:
  -----------
  [NVPTX] Fix pointer type for short 32-bit pointers

Global variables used to be printed as u64/b64 even when
-nvptx-short-ptr is set.

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


  Commit: 69e73d076b5711e2d19878b52014817b16ce8c55
      https://github.com/llvm/llvm-project/commit/69e73d076b5711e2d19878b52014817b16ce8c55
  Author: Andrew Savonichev <andrew.savonichev at gmail.com>
  Date:   2022-11-15 (Tue, 15 Nov 2022)

  Changed paths:
    M llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
    M llvm/test/CodeGen/NVPTX/short-ptr.ll

  Log Message:
  -----------
  [NVPTX] Fix pointer argument declaration for --nvptx-short-ptr

When --nvptx-short-ptr is set, local pointers are stored as 32-bit on
nvptx64 target.

Before this patch, arguments for a function declaration were always
emitted as b64 regardless of their address space, but they were set as
b32 for the corresponding call instruction:

   .extern .func test
   (
    .param .b64 test_param_0
   )
   [...]
    .param .b32 param0;
    st.param.b32 [param0+0], %r1;
    call.uni test, (param0);

This is not supported:

  ptxas: Type of argument does not match formal parameter
  'test_param_0'

Now short pointers in a function declaration are emitted as b32 if
--nvptx-short-ptr is set.

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


  Commit: 4f9321f92caf46a592cb6f0b95f7c6661cb5f48d
      https://github.com/llvm/llvm-project/commit/4f9321f92caf46a592cb6f0b95f7c6661cb5f48d
  Author: Andrew Savonichev <andrew.savonichev at gmail.com>
  Date:   2022-11-15 (Tue, 15 Nov 2022)

  Changed paths:
    M llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
    M llvm/test/CodeGen/NVPTX/call_bitcast_byval.ll

  Log Message:
  -----------
  [NVPTX] Fix alignment for arguments of function pointer calls

Alignment of function arguments can be increased only if we can do
this for all call sites. Therefore we do not increase it for external
functions, and now we skip functions that have address taken, to avoid
any issues with functions pointers.

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


Compare: https://github.com/llvm/llvm-project/compare/11abb7fedb55...4f9321f92caf


More information about the All-commits mailing list