aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Holewinski <jholewinski@nvidia.com>2012-12-05 20:50:28 +0000
committerJustin Holewinski <jholewinski@nvidia.com>2012-12-05 20:50:28 +0000
commit2f1086137dbabad072c98bd4d8dab15525ca4991 (patch)
treef85e32b4c355fb211c031b62cabf1db9bb19efd9
parenteef7b6219ebe5d0ded0be4adb3003055fa8a63c4 (diff)
[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
-rw-r--r--lib/Target/NVPTX/NVPTXISelLowering.cpp2
-rw-r--r--test/CodeGen/NVPTX/tuple-literal.ll5
2 files changed, 6 insertions, 1 deletions
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<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])
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
+}