SLPVectorizer: AllSameOpcode* starts "true" only for instructions

r251085 wasn't as NFC as intended...

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 251087
This commit is contained in:
Mehdi Amini 2015-10-23 01:04:45 +00:00
parent a96a8c4c08
commit d42ae865b8
1 changed files with 4 additions and 3 deletions

View File

@ -2002,9 +2002,6 @@ void BoUpSLP::reorderInputsAccordingToOpcode(ArrayRef<Value *> VL,
SmallVector<Value *, 16> OrigLeft, OrigRight; SmallVector<Value *, 16> OrigLeft, OrigRight;
bool AllSameOpcodeLeft = true;
bool AllSameOpcodeRight = true;
if (VL.size()) { if (VL.size()) {
// Peel the first iteration out of the loop since there's nothing // Peel the first iteration out of the loop since there's nothing
// interesting to do anyway and it simplifies the checks // interesting to do anyway and it simplifies the checks
@ -2019,6 +2016,10 @@ void BoUpSLP::reorderInputsAccordingToOpcode(ArrayRef<Value *> VL,
Right.push_back(VRight); Right.push_back(VRight);
} }
// Keep track if we have instructions with all the same opcode on one side.
bool AllSameOpcodeLeft = isa<Instruction>(Left[0]);
bool AllSameOpcodeRight = isa<Instruction>(Right[0]);
for (unsigned i = 1, e = VL.size(); i != e; ++i) { for (unsigned i = 1, e = VL.size(); i != e; ++i) {
Instruction *I = cast<Instruction>(VL[i]); Instruction *I = cast<Instruction>(VL[i]);