diff --git a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp index 8a8835e0269200..b5dce14cd0bc1e 100644 --- a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp +++ b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp @@ -2941,7 +2941,8 @@ void SPIRVInstructionSelector::extractSubvector( Register &ResVReg, const SPIRVType *ResType, Register &ReadReg, MachineInstr &InsertionPoint) const { SPIRVType *InputType = GR.getResultType(ReadReg); - uint64_t InputSize = GR.getScalarOrVectorComponentCount(InputType); + [[maybe_unused]] uint64_t InputSize = + GR.getScalarOrVectorComponentCount(InputType); uint64_t ResultSize = GR.getScalarOrVectorComponentCount(ResType); assert(InputSize > 1 && "The input must be a vector."); assert(ResultSize > 1 && "The result must be a vector.");