From 6f3ed8cfcfac6d09a12cc6dee00c772bf8600e5a 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356841 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Vectorize/SLPVectorizer.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 3d4d2a33241..5d3290cdc20 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/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.50.1