From 1466e5c383606570557db2ffd5f3b3a9eb81e52f Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 23 Mar 2019 16:56:23 +0000 Subject: [PATCH] Fix unused variable warning on non-asserts builds. NFCI. llvm-svn: 356841 --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 3d4d2a3..5d3290c 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -2917,8 +2917,6 @@ void BoUpSLP::reorderInputsAccordingToOpcode(const InstructionsState &S, ArrayRef VL, SmallVectorImpl &Left, SmallVectorImpl &Right) { - unsigned Opcode = S.getOpcode(); - if (!VL.empty()) { // Peel the first iteration out of the loop since there's nothing // interesting to do anyway and it simplifies the checks in the loop. @@ -2941,8 +2939,9 @@ void BoUpSLP::reorderInputsAccordingToOpcode(const InstructionsState &S, for (unsigned i = 1, e = VL.size(); i != e; ++i) { Instruction *I = cast(VL[i]); - assert(((I->getOpcode() == Opcode && I->isCommutative()) || - (I->getOpcode() != Opcode && Instruction::isCommutative(Opcode))) && + assert(((I->getOpcode() == S.getOpcode() && I->isCommutative()) || + (I->getOpcode() != S.getOpcode() && + Instruction::isCommutative(S.getOpcode()))) && "Can only process commutative instruction"); // Commute to favor either a splat or maximizing having the same opcodes on // one side. -- 2.7.4