[llvm] 215aba7 - [NVPTXLowerArgs] Use byval type

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 8 02:42:29 PST 2022


Author: Nikita Popov
Date: 2022-02-08T11:41:45+01:00
New Revision: 215aba771264c460498376ca56b7d720cbaf1265

URL: https://github.com/llvm/llvm-project/commit/215aba771264c460498376ca56b7d720cbaf1265
DIFF: https://github.com/llvm/llvm-project/commit/215aba771264c460498376ca56b7d720cbaf1265.diff

LOG: [NVPTXLowerArgs] Use byval type

Instead of pointer element type.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp b/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
index 67aa49132016d..6183019de43df 100644
--- a/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
@@ -229,11 +229,8 @@ static void convertToParamAS(Value *OldUser, Value *Param) {
 void NVPTXLowerArgs::handleByValParam(Argument *Arg) {
   Function *Func = Arg->getParent();
   Instruction *FirstInst = &(Func->getEntryBlock().front());
-  PointerType *PType = dyn_cast<PointerType>(Arg->getType());
-
-  assert(PType && "Expecting pointer type in handleByValParam");
-
-  Type *StructType = PType->getPointerElementType();
+  Type *StructType = Arg->getParamByValType();
+  assert(StructType && "Missing byval type");
 
   auto IsALoadChain = [&](Value *Start) {
     SmallVector<Value *, 16> ValuesToCheck = {Start};


        


More information about the llvm-commits mailing list