Lines 409-419
SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
Link Here
|
409 |
const size_t NumElements = ST->getNumElements(); |
409 |
const size_t NumElements = ST->getNumElements(); |
410 |
size_t SPIRVStructNumElements = NumElements; |
410 |
size_t SPIRVStructNumElements = NumElements; |
411 |
// In case number of elements is greater than maximum WordCount and |
411 |
// In case number of elements is greater than maximum WordCount and |
412 |
// SPV_INTEL_long_constant_composite is not enabled, the error will be |
412 |
// SPV_INTEL_long_composites is not enabled, the error will be |
413 |
// emitted by validate functionality of SPIRVTypeStruct class. |
413 |
// emitted by validate functionality of SPIRVTypeStruct class. |
414 |
if (NumElements > MaxNumElements && |
414 |
if (NumElements > MaxNumElements && |
415 |
BM->isAllowedToUseExtension( |
415 |
BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_long_composites)) { |
416 |
ExtensionID::SPV_INTEL_long_constant_composite)) { |
|
|
417 |
SPIRVStructNumElements = MaxNumElements; |
416 |
SPIRVStructNumElements = MaxNumElements; |
418 |
} |
417 |
} |
419 |
|
418 |
|
Lines 421-428
SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
Link Here
|
421 |
mapType(T, Struct); |
420 |
mapType(T, Struct); |
422 |
|
421 |
|
423 |
if (NumElements > MaxNumElements && |
422 |
if (NumElements > MaxNumElements && |
424 |
BM->isAllowedToUseExtension( |
423 |
BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_long_composites)) { |
425 |
ExtensionID::SPV_INTEL_long_constant_composite)) { |
|
|
426 |
uint64_t NumOfContinuedInstructions = NumElements / MaxNumElements - 1; |
424 |
uint64_t NumOfContinuedInstructions = NumElements / MaxNumElements - 1; |
427 |
for (uint64_t J = 0; J < NumOfContinuedInstructions; J++) { |
425 |
for (uint64_t J = 0; J < NumOfContinuedInstructions; J++) { |
428 |
auto *Continued = BM->addTypeStructContinuedINTEL(MaxNumElements); |
426 |
auto *Continued = BM->addTypeStructContinuedINTEL(MaxNumElements); |
Lines 1832-1839
LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
Link Here
|
1832 |
} else |
1830 |
} else |
1833 |
BVarInit = I->second; |
1831 |
BVarInit = I->second; |
1834 |
} else if (Init && !isa<UndefValue>(Init)) { |
1832 |
} else if (Init && !isa<UndefValue>(Init)) { |
1835 |
if (!BM->isAllowedToUseExtension( |
1833 |
if (!BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_long_composites)) { |
1836 |
ExtensionID::SPV_INTEL_long_constant_composite)) { |
|
|
1837 |
if (auto ArrTy = dyn_cast_or_null<ArrayType>(Init->getType())) { |
1834 |
if (auto ArrTy = dyn_cast_or_null<ArrayType>(Init->getType())) { |
1838 |
// First 3 words of OpConstantComposite encode: 1) word count & |
1835 |
// First 3 words of OpConstantComposite encode: 1) word count & |
1839 |
// opcode, 2) Result Type and 3) Result Id. Max length of SPIRV |
1836 |
// opcode, 2) Result Type and 3) Result Id. Max length of SPIRV |