Skip to content

Commit a75620b

Browse files
vmaksimojsji
authored andcommitted
Replace SPV_INTEL_long_composites ext with the SPV_INTEL_long_composites (#2968)
This continues #2258 All the backports with the rename has reached the backend drivers, so now it's safe to remove the old naming. Original commit: KhronosGroup/SPIRV-LLVM-Translator@ee6e8fac80c53ff
1 parent a7c761c commit a75620b

File tree

7 files changed

+20
-23
lines changed

7 files changed

+20
-23
lines changed

llvm-spirv/include/LLVMSPIRVExtensions.inc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ EXT(SPV_INTEL_variable_length_array)
4444
EXT(SPV_INTEL_fp_fast_math_mode)
4545
EXT(SPV_INTEL_fpga_cluster_attributes)
4646
EXT(SPV_INTEL_loop_fuse)
47-
EXT(SPV_INTEL_long_constant_composite) // TODO: rename to
48-
// SPV_INTEL_long_composites later
47+
EXT(SPV_INTEL_long_composites)
4948
EXT(SPV_INTEL_optnone)
5049
EXT(SPV_INTEL_fpga_dsp_control)
5150
EXT(SPV_INTEL_memory_access_aliasing)

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -496,20 +496,18 @@ SPIRVType *LLVMToSPIRVBase::transType(Type *T) {
496496
const size_t NumElements = ST->getNumElements();
497497
size_t SPIRVStructNumElements = NumElements;
498498
// In case number of elements is greater than maximum WordCount and
499-
// SPV_INTEL_long_constant_composite is not enabled, the error will be
499+
// SPV_INTEL_long_composites is not enabled, the error will be
500500
// emitted by validate functionality of SPIRVTypeStruct class.
501501
if (NumElements > MaxNumElements &&
502-
BM->isAllowedToUseExtension(
503-
ExtensionID::SPV_INTEL_long_constant_composite)) {
502+
BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_long_composites)) {
504503
SPIRVStructNumElements = MaxNumElements;
505504
}
506505

507506
auto *Struct = BM->openStructType(SPIRVStructNumElements, Name.str());
508507
mapType(T, Struct);
509508

510509
if (NumElements > MaxNumElements &&
511-
BM->isAllowedToUseExtension(
512-
ExtensionID::SPV_INTEL_long_constant_composite)) {
510+
BM->isAllowedToUseExtension(ExtensionID::SPV_INTEL_long_composites)) {
513511
uint64_t NumOfContinuedInstructions = NumElements / MaxNumElements - 1;
514512
for (uint64_t J = 0; J < NumOfContinuedInstructions; J++) {
515513
auto *Continued = BM->addTypeStructContinuedINTEL(MaxNumElements);
@@ -2054,7 +2052,7 @@ LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
20542052
BVarInit = I->second;
20552053
} else if (Init && !isa<UndefValue>(Init)) {
20562054
if (!BM->isAllowedToUseExtension(
2057-
ExtensionID::SPV_INTEL_long_constant_composite)) {
2055+
ExtensionID::SPV_INTEL_long_composites)) {
20582056
if (auto *ArrTy = dyn_cast_or_null<ArrayType>(Init->getType())) {
20592057
// First 3 words of OpConstantComposite encode: 1) word count &
20602058
// opcode, 2) Result Type and 3) Result Id. Max length of SPIRV

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVEntry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ class SPIRVContinuedInstINTELBase : public SPIRVEntryNoId<OC> {
966966
}
967967

968968
std::optional<ExtensionID> getRequiredExtension() const override {
969-
return ExtensionID::SPV_INTEL_long_constant_composite;
969+
return ExtensionID::SPV_INTEL_long_composites;
970970
}
971971

972972
SPIRVWord getNumElements() const { return Elements.size(); }

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVModule.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,10 +1291,10 @@ SPIRVValue *SPIRVModuleImpl::addCompositeConstant(
12911291
const int NumElements = Elements.size();
12921292

12931293
// In case number of elements is greater than maximum WordCount and
1294-
// SPV_INTEL_long_constant_composite is not enabled, the error will be emitted
1294+
// SPV_INTEL_long_composites is not enabled, the error will be emitted
12951295
// by validate functionality of SPIRVCompositeConstant class.
12961296
if (NumElements <= MaxNumElements ||
1297-
!isAllowedToUseExtension(ExtensionID::SPV_INTEL_long_constant_composite))
1297+
!isAllowedToUseExtension(ExtensionID::SPV_INTEL_long_composites))
12981298
return addConstant(new SPIRVConstantComposite(this, Ty, getId(), Elements));
12991299

13001300
auto Start = Elements.begin();
@@ -1326,10 +1326,10 @@ SPIRVValue *SPIRVModuleImpl::addSpecConstantComposite(
13261326
const int NumElements = Elements.size();
13271327

13281328
// In case number of elements is greater than maximum WordCount and
1329-
// SPV_INTEL_long_constant_composite is not enabled, the error will be emitted
1329+
// SPV_INTEL_long_composites is not enabled, the error will be emitted
13301330
// by validate functionality of SPIRVSpecConstantComposite class.
13311331
if (NumElements <= MaxNumElements ||
1332-
!isAllowedToUseExtension(ExtensionID::SPV_INTEL_long_constant_composite))
1332+
!isAllowedToUseExtension(ExtensionID::SPV_INTEL_long_composites))
13331333
return addConstant(
13341334
new SPIRVSpecConstantComposite(this, Ty, getId(), Elements));
13351335

llvm-spirv/test/SpecConstants/long-spec-const-composite.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; RUN: llvm-as %s -o %t.bc
2-
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_constant_composite %t.bc -o %t.spv
2+
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_composites %t.bc -o %t.spv
33
; RUN: llvm-spirv %t.spv --to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
44
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
55
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
@@ -12,7 +12,7 @@ target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:
1212
target triple = "spir64-unknown-unknown"
1313

1414
; CHECK-SPIRV: Capability LongCompositesINTEL
15-
; CHECK-SPIRV: Extension "SPV_INTEL_long_constant_composite"
15+
; CHECK-SPIRV: Extension "SPV_INTEL_long_composites"
1616
; CHECK-SPIRV-DAG: Decorate [[First:[0-9]+]] SpecId 0
1717
; CHECK-SPIRV-DAG: Decorate [[Last:[0-9]+]] SpecId 65548
1818
; CHECK-SPIRV: TypeInt [[TInt:[0-9]+]] 8

llvm-spirv/test/long-constant-array.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
; RUN: llvm-as %s -o %t.bc
22
; RUN: not llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
33

4-
; Check that everything is fine if SPV_INTEL_long_constant_composite is enabled
5-
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_constant_composite %t.bc -o %t.spv
4+
; Check that everything is fine if SPV_INTEL_long_composites is enabled
5+
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_composites %t.bc -o %t.spv
66
; RUN: llvm-spirv %t.spv --to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV
77
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
88
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
99
; TODO: run validator once it supports the extension
1010
; RUNx: spirv-val %t.spv
1111

1212
; CHECK-SPIRV: Capability LongCompositesINTEL
13-
; CHECK-SPIRV: Extension "SPV_INTEL_long_constant_composite"
13+
; CHECK-SPIRV: Extension "SPV_INTEL_long_composites"
1414
; CHECK-SPIRV: TypeInt [[TInt:[0-9]+]] 8
1515
; CHECK-SPIRV: Constant {{[0-9]+}} [[ArrSize:[0-9]+]] 78000
1616
; CHECK-SPIRV: TypeArray [[TArr:[0-9]+]] [[TInt]] [[ArrSize]]

llvm-spirv/test/long-type-struct.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
; RUN: llvm-as %s -o %t.bc
2-
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_constant_composite %t.bc -o %t.spv
2+
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_composites %t.bc -o %t.spv
33
; RUN: llvm-spirv %t.spv --to-text -o - | FileCheck %s --check-prefixes=CHECK-SPIRV,CHECK-SPIRV-TYPED-PTR
44
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
5-
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_constant_composite -spirv-text %t.rev.bc -o %t2.spt
5+
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_composites -spirv-text %t.rev.bc -o %t2.spt
66
; RUN: FileCheck --input-file=%t2.spt %s --check-prefixes=CHECK-SPIRV,CHECK-SPIRV-TYPED-PTR
77
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
88
; TODO: run validator once it supports the extension
99
; RUNx: spirv-val %t.spv
1010

1111
; RUN: not llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
1212

13-
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_constant_composite,+SPV_KHR_untyped_pointers %t.bc -o %t.spv
13+
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_composites,+SPV_KHR_untyped_pointers %t.bc -o %t.spv
1414
; RUN: llvm-spirv %t.spv --to-text -o - | FileCheck %s --check-prefixes=CHECK-SPIRV,CHECK-SPIRV-UNTYPED-PTR
1515
; RUN: llvm-spirv -r %t.spv -o %t.rev.bc
16-
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_constant_composite,+SPV_KHR_untyped_pointers -spirv-text %t.rev.bc -o %t2.spt
16+
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_long_composites,+SPV_KHR_untyped_pointers -spirv-text %t.rev.bc -o %t2.spt
1717
; RUN: FileCheck --input-file=%t2.spt %s --check-prefixes=CHECK-SPIRV,CHECK-SPIRV-UNTYPED-PTR
1818
; RUN: llvm-dis < %t.rev.bc | FileCheck %s --check-prefix=CHECK-LLVM
1919
; TODO: run validator once it supports the extension
@@ -22,7 +22,7 @@
2222
; RUN: not llvm-spirv %t.bc -o %t.spv 2>&1 | FileCheck %s --check-prefix=CHECK-ERROR
2323

2424
; CHECK-SPIRV: Capability LongCompositesINTEL
25-
; CHECK-SPIRV: Extension "SPV_INTEL_long_constant_composite"
25+
; CHECK-SPIRV: Extension "SPV_INTEL_long_composites"
2626
; CHECK-SPIRV: TypeInt [[TInt:[0-9]+]] 8
2727
; CHECK-SPIRV-TYPED-PTR: TypePointer [[TIntPtr:[0-9]+]] 8 [[TInt]]
2828
; CHECK-SPIRV-UNTYPED-PTR: TypeUntypedPointerKHR [[TIntPtr:[0-9]+]] 8

0 commit comments

Comments
 (0)