mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
[NVPTX] Support constant vector globals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190997 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5df37dab76
commit
3917535b1a
@ -1864,7 +1864,7 @@ void NVPTXAsmPrinter::bufferLEByte(const Constant *CPV, int Bytes,
|
||||
case Type::VectorTyID:
|
||||
case Type::StructTyID: {
|
||||
if (isa<ConstantArray>(CPV) || isa<ConstantVector>(CPV) ||
|
||||
isa<ConstantStruct>(CPV)) {
|
||||
isa<ConstantStruct>(CPV) || isa<ConstantDataSequential>(CPV)) {
|
||||
int ElementSize = TD->getTypeAllocSize(CPV->getType());
|
||||
bufferAggregateConstant(CPV, aggBuffer);
|
||||
if (Bytes > ElementSize)
|
||||
|
7
test/CodeGen/NVPTX/constant-vectors.ll
Normal file
7
test/CodeGen/NVPTX/constant-vectors.ll
Normal file
@ -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> <float -6.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float> <float -3.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float> <float 3.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float> <float 6.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>], align 16
|
||||
|
Loading…
x
Reference in New Issue
Block a user