[llvm] r334934 - [SLPVectorizer] Avoid calling const VL.size() repeatedly in for-loop. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 18 04:35:36 PDT 2018
Author: rksimon
Date: Mon Jun 18 04:35:36 2018
New Revision: 334934
URL: http://llvm.org/viewvc/llvm-project?rev=334934&view=rev
Log:
[SLPVectorizer] Avoid calling const VL.size() repeatedly in for-loop. NFCI.
Modified:
llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=334934&r1=334933&r2=334934&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Mon Jun 18 04:35:36 2018
@@ -2859,7 +2859,7 @@ void BoUpSLP::reorderInputsAccordingToOp
// add a[1],c[2] load b[1]
// b[2] load b[2]
// add a[3],c[3] load b[3]
- for (unsigned j = 0; j < VL.size() - 1; ++j) {
+ for (unsigned j = 0, e = VL.size() - 1; j < e; ++j) {
if (LoadInst *L = dyn_cast<LoadInst>(Left[j])) {
if (LoadInst *L1 = dyn_cast<LoadInst>(Right[j + 1])) {
if (isConsecutiveAccess(L, L1, *DL, *SE)) {
More information about the llvm-commits
mailing list