From: Simon Pilgrim Date: Sat, 23 Mar 2019 16:56:23 +0000 (+0000) Subject: Fix unused variable warning on non-asserts builds. NFCI. X-Git-Tag: llvmorg-10-init~9310 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1466e5c383606570557db2ffd5f3b3a9eb81e52f;p=platform%2Fupstream%2Fllvm.git Fix unused variable warning on non-asserts builds. NFCI. llvm-svn: 356841 --- 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.