Skip to content

Commit

Permalink
[SPIRV] Mark maybe unused extractSubvector variable (#116117)
Browse files Browse the repository at this point in the history
Change #115178 introduced a variable that is only used in an assert,
which could result in an unused variable warning in builds without
asserts enabled. This just addes the maybe_unused attribute to silence
the warning.
  • Loading branch information
pow2clk authored Nov 14, 2024
1 parent b4d23cf commit c03b6e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit c03b6e8

Please sign in to comment.