[PATCH] D65468: [NVPTX] Fix PR41651

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 12:53:20 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL367349: [NVPTX] Fix PR41651 (authored by hliao, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D65468?vs=212413&id=212415#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65468/new/

https://reviews.llvm.org/D65468

Files:
  llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
  llvm/trunk/test/CodeGen/NVPTX/bug41651.ll


Index: llvm/trunk/test/CodeGen/NVPTX/bug41651.ll
===================================================================
--- llvm/trunk/test/CodeGen/NVPTX/bug41651.ll
+++ llvm/trunk/test/CodeGen/NVPTX/bug41651.ll
@@ -0,0 +1,13 @@
+; RUN: llc -filetype=asm -o - %s | FileCheck %s
+target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
+target triple = "nvptx64-nvidia-cuda"
+
+%func = type { i32 (i32, i32)** }
+
+; CHECK: foo
+; CHECK: call
+; CHECK: ret
+define void @foo() {
+  %call = call %func undef(i32 0, i32 1)
+  ret void
+}
Index: llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -1291,8 +1291,8 @@
       O << ".param .b" << size << " _";
     } else if (isa<PointerType>(retTy)) {
       O << ".param .b" << PtrVT.getSizeInBits() << " _";
-    } else if (retTy->isAggregateType() || retTy->isVectorTy() || retTy->isIntegerTy(128)) {
-      auto &DL = CS.getCalledFunction()->getParent()->getDataLayout();
+    } else if (retTy->isAggregateType() || retTy->isVectorTy() ||
+               retTy->isIntegerTy(128)) {
       O << ".param .align " << retAlignment << " .b8 _["
         << DL.getTypeAllocSize(retTy) << "]";
     } else {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65468.212415.patch
Type: text/x-patch
Size: 1332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190730/a256a70a/attachment.bin>


More information about the llvm-commits mailing list