From 3917535b1af06f03dc0150fc956fb05218a78292 Mon Sep 17 00:00:00 2001 From: Justin Holewinski Date: Thu, 19 Sep 2013 12:51:46 +0000 Subject: [PATCH] [NVPTX] Support constant vector globals git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190997 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 2 +- test/CodeGen/NVPTX/constant-vectors.ll | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test/CodeGen/NVPTX/constant-vectors.ll diff --git a/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/lib/Target/NVPTX/NVPTXAsmPrinter.cpp index 12f18c478ac..10f685443fa 100644 --- a/lib/Target/NVPTX/NVPTXAsmPrinter.cpp +++ b/lib/Target/NVPTX/NVPTXAsmPrinter.cpp @@ -1864,7 +1864,7 @@ void NVPTXAsmPrinter::bufferLEByte(const Constant *CPV, int Bytes, case Type::VectorTyID: case Type::StructTyID: { if (isa(CPV) || isa(CPV) || - isa(CPV)) { + isa(CPV) || isa(CPV)) { int ElementSize = TD->getTypeAllocSize(CPV->getType()); bufferAggregateConstant(CPV, aggBuffer); if (Bytes > ElementSize) diff --git a/test/CodeGen/NVPTX/constant-vectors.ll b/test/CodeGen/NVPTX/constant-vectors.ll new file mode 100644 index 00000000000..7a6875669d9 --- /dev/null +++ b/test/CodeGen/NVPTX/constant-vectors.ll @@ -0,0 +1,7 @@ +; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s + +target triple = "nvptx-nvidia-cuda" + +; CHECK: .visible .global .align 16 .b8 sphPosArr[80] = {0, 0, 192, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 64, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 192, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63}; +@sphPosArr = constant [5 x <4 x float>] [<4 x float> , <4 x float> , <4 x float> , <4 x float> , <4 x float> ], align 16 + -- 2.34.1