diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index 8989b13cccc..295cd52f1e6 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -1854,10 +1854,10 @@ void BoUpSLP::reorderAltShuffleOperands(ArrayRef VL, if (LoadInst *L1 = dyn_cast(Right[j + 1])) { Instruction *VL1 = cast(VL[j]); Instruction *VL2 = cast(VL[j + 1]); - if (isConsecutiveAccess(L, L1, DL, *SE) && VL1->isCommutative()) { + if (VL1->isCommutative() && isConsecutiveAccess(L, L1, DL, *SE)) { std::swap(Left[j], Right[j]); continue; - } else if (isConsecutiveAccess(L, L1, DL, *SE) && VL2->isCommutative()) { + } else if (VL2->isCommutative() && isConsecutiveAccess(L, L1, DL, *SE)) { std::swap(Left[j + 1], Right[j + 1]); continue; } @@ -1868,10 +1868,10 @@ void BoUpSLP::reorderAltShuffleOperands(ArrayRef VL, if (LoadInst *L1 = dyn_cast(Left[j + 1])) { Instruction *VL1 = cast(VL[j]); Instruction *VL2 = cast(VL[j + 1]); - if (isConsecutiveAccess(L, L1, DL, *SE) && VL1->isCommutative()) { + if (VL1->isCommutative() && isConsecutiveAccess(L, L1, DL, *SE)) { std::swap(Left[j], Right[j]); continue; - } else if (isConsecutiveAccess(L, L1, DL, *SE) && VL2->isCommutative()) { + } else if (VL2->isCommutative() && isConsecutiveAccess(L, L1, DL, *SE)) { std::swap(Left[j + 1], Right[j + 1]); continue; }