[llvm] 80267c8 - [NVPTXISelLowering] Use byval IndirectType

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 8 03:09:14 PST 2022


Author: Nikita Popov
Date: 2022-02-08T12:08:52+01:00
New Revision: 80267c8887cea19dfbe15a686a1e915a24b5dba9

URL: https://github.com/llvm/llvm-project/commit/80267c8887cea19dfbe15a686a1e915a24b5dba9
DIFF: https://github.com/llvm/llvm-project/commit/80267c8887cea19dfbe15a686a1e915a24b5dba9.diff

LOG: [NVPTXISelLowering] Use byval IndirectType

Instead of the pointer element type.

Added: 
    

Modified: 
    llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index 74b38dc2e706..956fbfa393c5 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -1571,10 +1571,8 @@ SDValue NVPTXTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
     // ByVal arguments
     SmallVector<EVT, 16> VTs;
     SmallVector<uint64_t, 16> Offsets;
-    auto *PTy = dyn_cast<PointerType>(Args[i].Ty);
-    assert(PTy && "Type of a byval parameter should be pointer");
-    ComputePTXValueVTs(*this, DL, PTy->getPointerElementType(), VTs, &Offsets,
-                       0);
+    assert(Args[i].IndirectType && "byval arg must have indirect type");
+    ComputePTXValueVTs(*this, DL, Args[i].IndirectType, VTs, &Offsets, 0);
 
     // declare .param .align <align> .b8 .param<n>[<size>];
     unsigned sz = Outs[OIdx].Flags.getByValSize();


        


More information about the llvm-commits mailing list