When --nvptx-short-ptr is set, local pointers are 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 correctly
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.
This patch fixes the bug found in https://reviews.llvm.org/D127668#3587241.
Should there be an else PTySizeInBits = TLI->getPointerTy(DL).getSizeInBits() ?