Skip to content

Commit 05e183d

Browse files
authored
Rename OpConstFunctionPointerINTEL to OpConstantFunctionPointerINTEL (#1265)
Signed-off-by: Dmitry Sidorov <[email protected]>
1 parent ad378df commit 05e183d

17 files changed

+38
-36
lines changed

lib/SPIRV/SPIRVReader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,9 +1454,9 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
14541454
return mapValue(BV, transValue(BI, nullptr, nullptr, false));
14551455
}
14561456

1457-
case OpConstFunctionPointerINTEL: {
1458-
SPIRVConstFunctionPointerINTEL *BC =
1459-
static_cast<SPIRVConstFunctionPointerINTEL *>(BV);
1457+
case OpConstantFunctionPointerINTEL: {
1458+
SPIRVConstantFunctionPointerINTEL *BC =
1459+
static_cast<SPIRVConstantFunctionPointerINTEL *>(BV);
14601460
SPIRVFunction *F = BC->getFunction();
14611461
BV->setName(F->getName());
14621462
return mapValue(BV, transFunction(F));

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,7 @@ LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
14121412
if (!BM->checkExtension(ExtensionID::SPV_INTEL_function_pointers,
14131413
SPIRVEC_FunctionPointers, toString(V)))
14141414
return nullptr;
1415-
return BM->addConstFunctionPointerINTEL(
1415+
return BM->addConstantFunctionPointerINTEL(
14161416
transType(F->getType()),
14171417
static_cast<SPIRVFunction *>(transValue(F, nullptr)));
14181418
}

lib/SPIRV/SPIRVWriter.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ class LLVMToSPIRVBase {
7575
// a function, that is necessary for a convenient function pointers handling.
7676
// By default transValue uses 'Decl' mode, which means every function
7777
// we meet during the translation should result in its declaration generated.
78-
// In 'Pointer' mode we generate OpConstFunctionPointerINTEL constant instead.
78+
// In 'Pointer' mode we generate OpConstantFunctionPointerINTEL constant
79+
// instead.
7980
enum class FuncTransMode { Decl, Pointer };
8081

8182
SPIRVType *transType(Type *T);

lib/SPIRV/libSPIRV/SPIRVFunction.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,18 @@ class SPIRVFunction : public SPIRVValue, public SPIRVComponentExecutionModes {
171171

172172
typedef SPIRVEntryOpCodeOnly<OpFunctionEnd> SPIRVFunctionEnd;
173173

174-
class SPIRVConstFunctionPointerINTEL : public SPIRVValue {
175-
const static Op OC = OpConstFunctionPointerINTEL;
174+
class SPIRVConstantFunctionPointerINTEL : public SPIRVValue {
175+
const static Op OC = OpConstantFunctionPointerINTEL;
176176
const static SPIRVWord FixedWordCount = 4;
177177

178178
public:
179-
SPIRVConstFunctionPointerINTEL(SPIRVId TheId, SPIRVType *TheType,
180-
SPIRVFunction *TheFunction, SPIRVModule *M)
179+
SPIRVConstantFunctionPointerINTEL(SPIRVId TheId, SPIRVType *TheType,
180+
SPIRVFunction *TheFunction, SPIRVModule *M)
181181
: SPIRVValue(M, FixedWordCount, OC, TheType, TheId),
182182
TheFunction(TheFunction->getId()) {
183183
validate();
184184
}
185-
SPIRVConstFunctionPointerINTEL()
185+
SPIRVConstantFunctionPointerINTEL()
186186
: SPIRVValue(OC), TheFunction(SPIRVID_INVALID) {}
187187
SPIRVFunction *getFunction() const { return get<SPIRVFunction>(TheFunction); }
188188
_SPIRV_DEF_ENCDEC3(Type, Id, TheFunction)

lib/SPIRV/libSPIRV/SPIRVModule.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ class SPIRVModuleImpl : public SPIRVModule {
272272
const std::vector<SPIRVValue *> &Elements) override;
273273
SPIRVEntry *addSpecConstantCompositeContinuedINTEL(
274274
const std::vector<SPIRVValue *> &) override;
275-
SPIRVValue *addConstFunctionPointerINTEL(SPIRVType *Ty,
276-
SPIRVFunction *F) override;
275+
SPIRVValue *addConstantFunctionPointerINTEL(SPIRVType *Ty,
276+
SPIRVFunction *F) override;
277277
SPIRVValue *addConstant(SPIRVValue *) override;
278278
SPIRVValue *addConstant(SPIRVType *, uint64_t) override;
279279
SPIRVValue *addConstant(SPIRVType *, llvm::APInt) override;
@@ -1153,9 +1153,10 @@ SPIRVEntry *SPIRVModuleImpl::addSpecConstantCompositeContinuedINTEL(
11531153
return add(new SPIRVSpecConstantCompositeContinuedINTEL(this, Elements));
11541154
}
11551155

1156-
SPIRVValue *SPIRVModuleImpl::addConstFunctionPointerINTEL(SPIRVType *Ty,
1157-
SPIRVFunction *F) {
1158-
return addConstant(new SPIRVConstFunctionPointerINTEL(getId(), Ty, F, this));
1156+
SPIRVValue *SPIRVModuleImpl::addConstantFunctionPointerINTEL(SPIRVType *Ty,
1157+
SPIRVFunction *F) {
1158+
return addConstant(
1159+
new SPIRVConstantFunctionPointerINTEL(getId(), Ty, F, this));
11591160
}
11601161

11611162
SPIRVValue *SPIRVModuleImpl::addUndef(SPIRVType *TheType) {

lib/SPIRV/libSPIRV/SPIRVModule.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ class SPIRVModule {
267267
const std::vector<SPIRVValue *> &Elements) = 0;
268268
virtual SPIRVEntry *
269269
addSpecConstantCompositeContinuedINTEL(const std::vector<SPIRVValue *> &) = 0;
270-
virtual SPIRVValue *addConstFunctionPointerINTEL(SPIRVType *Ty,
271-
SPIRVFunction *F) = 0;
270+
virtual SPIRVValue *addConstantFunctionPointerINTEL(SPIRVType *Ty,
271+
SPIRVFunction *F) = 0;
272272
virtual SPIRVValue *addConstant(SPIRVValue *) = 0;
273273
virtual SPIRVValue *addConstant(SPIRVType *, uint64_t) = 0;
274274
virtual SPIRVValue *addConstant(SPIRVType *, llvm::APInt) = 0;

lib/SPIRV/libSPIRV/SPIRVOpCode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ inline bool isSpecConstantOpCode(Op OpCode) {
227227
inline bool isConstantOpCode(Op OpCode) {
228228
unsigned OC = OpCode;
229229
return (OpConstantTrue <= OC && OC <= OpSpecConstantOp) || OC == OpUndef ||
230-
OC == OpConstantPipeStorage || OC == OpConstFunctionPointerINTEL;
230+
OC == OpConstantPipeStorage || OC == OpConstantFunctionPointerINTEL;
231231
}
232232

233233
inline bool isModuleScopeAllowedOpCode(Op OpCode) {

lib/SPIRV/libSPIRV/SPIRVOpCodeEnum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ _SPIRV_OP(SubgroupImageBlockReadINTEL, 5577)
344344
_SPIRV_OP(SubgroupImageBlockWriteINTEL, 5578)
345345
_SPIRV_OP(SubgroupImageMediaBlockReadINTEL, 5580)
346346
_SPIRV_OP(SubgroupImageMediaBlockWriteINTEL, 5581)
347-
_SPIRV_OP(ConstFunctionPointerINTEL, 5600)
347+
_SPIRV_OP(ConstantFunctionPointerINTEL, 5600)
348348
_SPIRV_OP(FunctionPointerCallINTEL, 5601)
349349
_SPIRV_OP(AsmTargetINTEL, 5609)
350350
_SPIRV_OP(AsmINTEL, 5610)

spirv-headers-tag.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ddf3230c14c71e81fc0eae9b781cc4bcc2d1f0f5
1+
814e728b30ddd0f4509233099a3ad96fd4318c07

test/constexpr_vector.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@
6262
; CHECK-SPIRV-DAG: 4 TypePointer [[StorePtr:[0-9]+]] 7 [[TypeVec16]]
6363
; CHECK-SPIRV-DAG: 3 Undef [[TypeVec16]] [[TypeUndefV16:[0-9]+]]
6464
; CHECK-SPIRV-DAG: 3 Undef [[TypeVec64]] [[TypeUndefV64:[0-9]+]]
65-
; CHECK-SPIRV-DAG: 4 ConstFunctionPointerINTEL [[FuncPtrTy:[0-9]+]] [[F1Ptr:[0-9]+]] [[F1]]
66-
; CHECK-SPIRV-DAG: 4 ConstFunctionPointerINTEL [[FuncPtrTy]] [[F2Ptr:[0-9]+]] [[F2]]
67-
; CHECK-SPIRV-DAG: 4 ConstFunctionPointerINTEL [[FuncPtrTy]] [[F11Ptr:[0-9]+]] [[F1]]
68-
; CHECK-SPIRV-DAG: 4 ConstFunctionPointerINTEL [[FuncPtrTy]] [[F21Ptr:[0-9]+]] [[F2]]
65+
; CHECK-SPIRV-DAG: 4 ConstantFunctionPointerINTEL [[FuncPtrTy:[0-9]+]] [[F1Ptr:[0-9]+]] [[F1]]
66+
; CHECK-SPIRV-DAG: 4 ConstantFunctionPointerINTEL [[FuncPtrTy]] [[F2Ptr:[0-9]+]] [[F2]]
67+
; CHECK-SPIRV-DAG: 4 ConstantFunctionPointerINTEL [[FuncPtrTy]] [[F11Ptr:[0-9]+]] [[F1]]
68+
; CHECK-SPIRV-DAG: 4 ConstantFunctionPointerINTEL [[FuncPtrTy]] [[F21Ptr:[0-9]+]] [[F2]]
6969

7070
; CHECK-SPIRV: 4 ConvertPtrToU [[TypeInt64]] [[Ptr1:[0-9]+]] [[F1Ptr]]
7171
; CHECK-SPIRV: 4 Bitcast [[TypeVec8]] [[Vec1:[0-9]+]] [[Ptr1]]

test/transcoding/SPV_INTEL_function_pointers/bitcast.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
; CHECK-SPIRV: TypeFunction [[#DEST_TY:]] [[#]] [[#]]
1919
; CHECK-SPIRV: TypePointer [[#DEST_TY_PTR:]] [[#]] [[#DEST_TY]]
2020
; CHECK-SPIRV: TypePointer [[#FOO_TY_PTR:]] [[#]] [[#FOO_TY]]
21-
; CHECK-SPIRV: ConstFunctionPointerINTEL [[#FOO_TY_PTR]] [[#FOO_PTR:]] [[#FOO:]]
21+
; CHECK-SPIRV: ConstantFunctionPointerINTEL [[#FOO_TY_PTR]] [[#FOO_PTR:]] [[#FOO:]]
2222
; CHECK-SPIRV: Function [[#]] [[#FOO]] [[#]] [[#FOO_TY]]
2323

2424
; CHECK-SPIRV: Bitcast [[#DEST_TY_PTR]] [[#]] [[#FOO_PTR]]

test/transcoding/SPV_INTEL_function_pointers/const-function-pointer.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
; CHECK-SPIRV-DAG: Constant [[Int32]] [[XArg:[0-9]+]] 32
1515
; CHECK-SPIRV-DAG: Constant [[Int32]] [[YArg:[0-9]+]] 2
1616

17-
; CHECK-SPIRV: ConstFunctionPointerINTEL {{[0-9]+}} [[F1:[0-9]+]] [[F1Name]]
18-
; CHECK-SPIRV: ConstFunctionPointerINTEL {{[0-9]+}} [[F2:[0-9]+]] [[F2Name]]
17+
; CHECK-SPIRV: ConstantFunctionPointerINTEL {{[0-9]+}} [[F1:[0-9]+]] [[F1Name]]
18+
; CHECK-SPIRV: ConstantFunctionPointerINTEL {{[0-9]+}} [[F2:[0-9]+]] [[F2Name]]
1919
; CHECK-SPIRV: ConstantComposite {{[0-9]+}} [[ConstComp:[0-9]+]] [[F1]] [[F2]]
2020
; CHECK-SPIRV: Variable {{[0-9]+}} [[Var:[0-9]+]] {{[0-9]+}} [[ConstComp]]
2121

test/transcoding/SPV_INTEL_function_pointers/function-pointer.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
; CHECK-SPIRV: TypeFunction [[FOO_TYPE_ID:[0-9]+]] [[TYPE_INT_ID]] [[TYPE_INT_ID]]
2525
; CHECK-SPIRV: TypePointer [[FOO_PTR_ID:[0-9]+]] {{[0-9]+}} [[FOO_TYPE_ID]]
2626
; CHECK-SPIRV: TypePointer [[FOO_PTR_ALLOCA_ID:[0-9]+]] 7 [[FOO_PTR_ID]]
27-
; CHECK-SPIRV: ConstFunctionPointerINTEL [[FOO_PTR_ID]] [[FOO_PTR:[0-9]+]] [[FOO_ID:[0-9]+]]
27+
; CHECK-SPIRV: ConstantFunctionPointerINTEL [[FOO_PTR_ID]] [[FOO_PTR:[0-9]+]] [[FOO_ID:[0-9]+]]
2828
;
2929
; CHECK-SPIRV: Function {{[0-9]+}} [[FOO_ID]] {{[0-9]+}} [[FOO_TYPE_ID]]
3030
; CHECK-SPIRV: Function {{[0-9]+}} [[KERNEL_ID]]

test/transcoding/SPV_INTEL_function_pointers/global_ctor_dtor.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ target triple = "spir64-unknown-unknown"
2222
; CHECK: TypeFunction {{[0-9]+}} [[TF:[0-9]+]]
2323

2424
; CHECK: TypePointer [[TP:[0-9]+]]
25-
; CHECK: ConstFunctionPointerINTEL [[TP]] [[FPCtor:[0-9]+]] [[NameCtor]]
25+
; CHECK: ConstantFunctionPointerINTEL [[TP]] [[FPCtor:[0-9]+]] [[NameCtor]]
2626
; CHECK: ConstantComposite {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} [[FPCtor]]
27-
; CHECK: ConstFunctionPointerINTEL [[TP]] [[FPDtor:[0-9]+]] [[NameDtor]]
27+
; CHECK: ConstantFunctionPointerINTEL [[TP]] [[FPDtor:[0-9]+]] [[NameDtor]]
2828
; CHECK: ConstantComposite {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} [[FPDtor]]
2929

3030
; CHECK: 5 Function [[TF]] [[NameCtor]] 0

test/transcoding/SPV_INTEL_function_pointers/non-uniform-function-pointer.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
; CHECK-SPIRV: TypeFunction [[FOO_TYPE_ID:[0-9]+]] [[TYPE_INT32_ID]] [[TYPE_INT32_ID]]
3535
; CHECK-SPIRV: TypePointer [[FOO_PTR_TYPE_ID:[0-9]+]] {{[0-9]+}} [[FOO_TYPE_ID]]
3636
; CHECK-SPIRV: TypePointer [[FOO_PTR_ALLOCA_TYPE_ID:[0-9]+]] 7 [[FOO_PTR_TYPE_ID]]
37-
; CHECK-SPIRV: ConstFunctionPointerINTEL [[FOO_PTR_TYPE_ID]] [[FOO_PTR_ID:[0-9]+]] [[FOO_ID:[0-9]+]]
38-
; CHECK-SPIRV: ConstFunctionPointerINTEL [[FOO_PTR_TYPE_ID]] [[BAR_PTR_ID:[0-9]+]] [[BAR_ID:[0-9]+]]
37+
; CHECK-SPIRV: ConstantFunctionPointerINTEL [[FOO_PTR_TYPE_ID]] [[FOO_PTR_ID:[0-9]+]] [[FOO_ID:[0-9]+]]
38+
; CHECK-SPIRV: ConstantFunctionPointerINTEL [[FOO_PTR_TYPE_ID]] [[BAR_PTR_ID:[0-9]+]] [[BAR_ID:[0-9]+]]
3939
;
4040
; CHECK-SPIRV: Function {{[0-9]+}} [[FOO_ID]] {{[0-9]+}} [[FOO_TYPE_ID]]
4141
; CHECK-SPIRV: Function {{[0-9]+}} [[BAR_ID]] {{[0-9]+}} [[FOO_TYPE_ID]]

test/transcoding/SPV_INTEL_function_pointers/select.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
; CHECK-SPIRV: TypeFunction [[#FUNC_TYPE:]] [[#INT32]] [[#INT32]]
1414
; CHECK-SPIRV: TypePointer [[#FUNC_PTR_TYPE:]] [[#]] [[#FUNC_TYPE]]
1515
; CHECK-SPIRV: TypePointer [[#FUNC_PTR_ALLOCA_TYPE:]] [[#]] [[#FUNC_PTR_TYPE]]
16-
; CHECK-SPIRV-DAG: ConstFunctionPointerINTEL [[#FUNC_PTR_TYPE]] [[#BARPTR:]] [[#BAR]]
17-
; CHECK-SPIRV-DAG: ConstFunctionPointerINTEL [[#FUNC_PTR_TYPE]] [[#BAZPTR:]] [[#BAZ]]
16+
; CHECK-SPIRV-DAG: ConstantFunctionPointerINTEL [[#FUNC_PTR_TYPE]] [[#BARPTR:]] [[#BAR]]
17+
; CHECK-SPIRV-DAG: ConstantFunctionPointerINTEL [[#FUNC_PTR_TYPE]] [[#BAZPTR:]] [[#BAZ]]
1818
; CHECK-SPIRV: Function [[#]] [[#KERNEL_ID]]
1919
; CHECK-SPIRV: Variable [[#FUNC_PTR_ALLOCA_TYPE]] [[#FPTR:]]
2020
; CHECK-SPIRV: Select [[#FUNC_PTR_TYPE]] [[#SELECT:]] [[#]] [[#BARPTR]] [[#BAZPTR]]

test/transcoding/SPV_INTEL_function_pointers/vector_elem.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
; CHECK-SPIRV: 4 TypePointer [[TypePtr:[0-9]+]] {{[0-9]+}} [[TypeFunc]]
1010
; CHECK-SPIRV: 4 TypeVector [[TypeVec:[0-9]+]] [[TypePtr]] [[TypeInt32]]
1111
; CHECK-SPIRV-DAG: 3 Undef [[TypeVec]] [[TypeUndef:[0-9]+]]
12-
; CHECK-SPIRV-DAG: 4 ConstFunctionPointerINTEL [[TypePtr]] [[F1Ptr:[0-9]+]] [[F1]]
13-
; CHECK-SPIRV-DAG: 4 ConstFunctionPointerINTEL [[TypePtr]] [[F2Ptr:[0-9]+]] [[F2]]
12+
; CHECK-SPIRV-DAG: 4 ConstantFunctionPointerINTEL [[TypePtr]] [[F1Ptr:[0-9]+]] [[F1]]
13+
; CHECK-SPIRV-DAG: 4 ConstantFunctionPointerINTEL [[TypePtr]] [[F2Ptr:[0-9]+]] [[F2]]
1414

1515
; CHECK-SPIRV: 6 CompositeInsert [[TypeVec]] [[NewVec0:[0-9]+]] [[F1Ptr]] [[TypeUndef]] 0
1616
; CHECK-SPIRV: 6 CompositeInsert [[TypeVec]] [[NewVec1:[0-9]+]] [[F2Ptr]] [[NewVec0]] 1

0 commit comments

Comments
 (0)