@@ -318,9 +318,6 @@ Instruction *emitSpecConstantComposite(Type *Ty,
318
318
// / first ID. If \c IsNewSpecConstant is false, this vector is expected to
319
319
// / contain enough elements to assign ID to each scalar element encountered in
320
320
// / the specified composite type.
321
- // / @param IsNewSpecConstant [in] Flag to specify whether \c IDs vector should
322
- // / be filled with new IDs or it should be used as-is to replicate an existing
323
- // / spec constant
324
321
// / @param [in,out] Index Index of scalar element within a composite type
325
322
// /
326
323
// / @returns Instruction* representing specialization constant in LLVM IR, which
@@ -333,7 +330,6 @@ Instruction *emitSpecConstantComposite(Type *Ty,
333
330
// / encountered scalars and assigns them IDs (or re-uses existing ones).
334
331
Instruction *emitSpecConstantRecursiveImpl (Type *Ty, Instruction *InsertBefore,
335
332
SmallVectorImpl<unsigned > &IDs,
336
- bool IsNewSpecConstant,
337
333
unsigned &Index) {
338
334
if (!Ty->isArrayTy () && !Ty->isStructTy () && !Ty->isVectorTy ()) { // Scalar
339
335
if (Index >= IDs.size ()) {
@@ -346,8 +342,8 @@ Instruction *emitSpecConstantRecursiveImpl(Type *Ty, Instruction *InsertBefore,
346
342
347
343
SmallVector<Instruction *, 8 > Elements;
348
344
auto LoopIteration = [&](Type *Ty) {
349
- Elements.push_back (emitSpecConstantRecursiveImpl (Ty, InsertBefore, IDs,
350
- IsNewSpecConstant , Index));
345
+ Elements.push_back (
346
+ emitSpecConstantRecursiveImpl (Ty, InsertBefore, IDs , Index));
351
347
};
352
348
353
349
if (auto *ArrTy = dyn_cast<ArrayType>(Ty)) {
@@ -371,11 +367,9 @@ Instruction *emitSpecConstantRecursiveImpl(Type *Ty, Instruction *InsertBefore,
371
367
372
368
// / Wrapper intended to hide IsFirstElement argument from the caller
373
369
Instruction *emitSpecConstantRecursive (Type *Ty, Instruction *InsertBefore,
374
- SmallVectorImpl<unsigned > &IDs,
375
- bool IsNewSpecConstant) {
370
+ SmallVectorImpl<unsigned > &IDs) {
376
371
unsigned Index = 0 ;
377
- return emitSpecConstantRecursiveImpl (Ty, InsertBefore, IDs, IsNewSpecConstant,
378
- Index);
372
+ return emitSpecConstantRecursiveImpl (Ty, InsertBefore, IDs, Index);
379
373
}
380
374
381
375
} // namespace
@@ -444,7 +438,7 @@ PreservedAnalyses SpecConstantsPass::run(Module &M,
444
438
// 3. Transform to spirv intrinsic _Z*__spirv_SpecConstant* or
445
439
// _Z*__spirv_SpecConstantComposite
446
440
auto *SPIRVCall =
447
- emitSpecConstantRecursive (SCTy, CI, IDs, IsNewSpecConstant );
441
+ emitSpecConstantRecursive (SCTy, CI, IDs);
448
442
if (IsNewSpecConstant) {
449
443
// emitSpecConstantRecursive might emit more than one spec constant
450
444
// (because of composite types) and therefore, we need to ajudst
0 commit comments