[llvm-commits] [llvm] r169418 - in /llvm/trunk: lib/Target/NVPTX/NVPTXISelLowering.cpp test/CodeGen/NVPTX/tuple-literal.ll

Justin Holewinski jholewinski at nvidia.com
Wed Dec 5 12:50:28 PST 2012


Author: jholewinski
Date: Wed Dec  5 14:50:28 2012
New Revision: 169418

URL: http://llvm.org/viewvc/llvm-project?rev=169418&view=rev
Log:
[NVPTX] Fix crash with unnamed struct arguments

Patch by Eric Holk

Added:
    llvm/trunk/test/CodeGen/NVPTX/tuple-literal.ll
Modified:
    llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp

Modified: llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp?rev=169418&r1=169417&r2=169418&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp Wed Dec  5 14:50:28 2012
@@ -957,7 +957,7 @@
     return false;
 
   const StructType *STy = dyn_cast<StructType>(PTy->getElementType());
-  const std::string TypeName = STy ? STy->getName() : "";
+  const std::string TypeName = STy && !STy->isLiteral() ? STy->getName() : "";
 
   for (int i = 0, e = array_lengthof(specialTypes); i != e; ++i)
     if (TypeName == specialTypes[i])

Added: llvm/trunk/test/CodeGen/NVPTX/tuple-literal.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/tuple-literal.ll?rev=169418&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/tuple-literal.ll (added)
+++ llvm/trunk/test/CodeGen/NVPTX/tuple-literal.ll Wed Dec  5 14:50:28 2012
@@ -0,0 +1,5 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_13
+
+define ptx_device void @test_function({i8, i8}*) {
+  ret void
+}





More information about the llvm-commits mailing list