From 2f1086137dbabad072c98bd4d8dab15525ca4991 Mon Sep 17 00:00:00 2001 From: Justin Holewinski Date: Wed, 5 Dec 2012 20:50:28 +0000 Subject: [NVPTX] Fix crash with unnamed struct arguments Patch by Eric Holk git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169418 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/NVPTX/NVPTXISelLowering.cpp | 2 +- test/CodeGen/NVPTX/tuple-literal.ll | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 test/CodeGen/NVPTX/tuple-literal.ll diff --git a/lib/Target/NVPTX/NVPTXISelLowering.cpp b/lib/Target/NVPTX/NVPTXISelLowering.cpp index d785fd2a47..96d8a505aa 100644 --- a/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -957,7 +957,7 @@ bool llvm::isImageOrSamplerVal(const Value *arg, const Module *context) { return false; const StructType *STy = dyn_cast(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]) diff --git a/test/CodeGen/NVPTX/tuple-literal.ll b/test/CodeGen/NVPTX/tuple-literal.ll new file mode 100644 index 0000000000..5c0cb2c15c --- /dev/null +++ b/test/CodeGen/NVPTX/tuple-literal.ll @@ -0,0 +1,5 @@ +; RUN: llc < %s -march=nvptx -mcpu=sm_13 + +define ptx_device void @test_function({i8, i8}*) { + ret void +} -- cgit v1.2.3-18-g5258