[all-commits] [llvm/llvm-project] 940fa3: [NVPTX] Fix a segfault for bitcasted calls with by...

ldrumm via All-commits all-commits at lists.llvm.org
Tue Oct 11 07:15:05 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 940fa35ece5294a115a2fdba89ef6c095d90df0f
  Author: Luke Drummond <luke.drummond at codeplay.com>
  Date:   2022-10-11 (Tue, 11 Oct 2022)

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

  Log Message:
  [NVPTX] Fix a segfault for bitcasted calls with byval params

`getFunctionParamOptimizedAlign` was being passed a null function
argument when getting the callee of a bitcasted function symbol. This is
because `CallBase::getCalledFunction` does not look through bitcasts.

There is already code to handle this case in
`NVPTXTargetLowering::getArgumentAlignment`, which is now hoisted into
an NVPTX util.

The alignment computation now gracefully handles computing alignment of
virtual functions with a check for null.

More information about the All-commits mailing list