[llvm] af7b4df - [NVPTXAsmPrinter] Use byval type

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


Author: Nikita Popov
Date: 2022-02-08T11:57:46+01:00
New Revision: af7b4df66716365e1de24e3c11a0db9355af329a

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

LOG: [NVPTXAsmPrinter] Use byval type

Instead of pointer element type.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
index 3a59306c4998..7392cd8be402 100644
--- a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
@@ -1511,10 +1511,9 @@ void NVPTXAsmPrinter::emitFunctionParamList(const Function *F, raw_ostream &O) {
       continue;
     }
 
-    // param has byVal attribute. So should be a pointer
-    auto *PTy = dyn_cast<PointerType>(Ty);
-    assert(PTy && "Param with byval attribute should be a pointer type");
-    Type *ETy = PTy->getPointerElementType();
+    // param has byVal attribute.
+    Type *ETy = PAL.getParamByValType(paramIndex);
+    assert(ETy && "Param should have byval type");
 
     if (isABI || isKernelFunc) {
       // Just print .param .align <a> .b8 .param[size];


        


More information about the llvm-commits mailing list