Skip to content

Commit b8048df

Browse files
SamTebbs33mahesh-attarde
authored andcommitted
[NFC][LV] Fix warning of unused SubConst variable
llvm#160154 added an assertion using a new variable, which caused a warning in builds without asserts. This patch adds [[maybe_unused]] to prevent that warning.
1 parent 7b6e547 commit b8048df

File tree

1 file changed

+1
-1
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3033,7 +3033,7 @@ class VPExpressionRecipe : public VPSingleDefRecipe {
30333033
assert(Red->getRecurrenceKind() == RecurKind::Add &&
30343034
"Expected an add reduction");
30353035
assert(getNumOperands() >= 3 && "Expected at least three operands");
3036-
auto *SubConst = dyn_cast<ConstantInt>(getOperand(2)->getLiveInIRValue());
3036+
[[maybe_unused]] auto *SubConst = dyn_cast<ConstantInt>(getOperand(2)->getLiveInIRValue());
30373037
assert(SubConst && SubConst->getValue() == 0 &&
30383038
Sub->getOpcode() == Instruction::Sub && "Expected a negating sub");
30393039
}

0 commit comments

Comments
 (0)