From: Mehdi Amini Date: Fri, 23 Oct 2015 01:04:45 +0000 (+0000) Subject: SLPVectorizer: AllSameOpcode* starts "true" only for instructions X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=1ac8af11c65c1ccad01f2bf1e0c40aca39516c60 SLPVectorizer: AllSameOpcode* starts "true" only for instructions r251085 wasn't as NFC as intended... From: Mehdi Amini git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251087 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 0930d580363..57b09caa5a4 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -2002,9 +2002,6 @@ void BoUpSLP::reorderInputsAccordingToOpcode(ArrayRef VL, SmallVector OrigLeft, OrigRight; - bool AllSameOpcodeLeft = true; - bool AllSameOpcodeRight = true; - if (VL.size()) { // Peel the first iteration out of the loop since there's nothing // interesting to do anyway and it simplifies the checks @@ -2019,6 +2016,10 @@ void BoUpSLP::reorderInputsAccordingToOpcode(ArrayRef VL, Right.push_back(VRight); } + // Keep track if we have instructions with all the same opcode on one side. + bool AllSameOpcodeLeft = isa(Left[0]); + bool AllSameOpcodeRight = isa(Right[0]); + for (unsigned i = 1, e = VL.size(); i != e; ++i) { Instruction *I = cast(VL[i]);