From 39a95032d2522970d482f0588335f4595d8dcee2 Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Mon, 11 Feb 2013 23:02:09 +0000 Subject: [PATCH] BBVectorize: Omit unnecessary entries in PairableInstUsers This map is queried only for instructions in pairs of pairable instructions; so make sure that only pairs of pairable instructions are added to the map. This gives a 3.5% speedup on the csa.ll test case from PR15222. No functionality change intended. llvm-svn: 174914 --- llvm/lib/Transforms/Vectorize/BBVectorize.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp index bf8fca0..b14d91d 100644 --- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp @@ -1390,8 +1390,10 @@ namespace { (void) trackUsesOfI(Users, WriteSet, I, J); for (DenseSet::iterator U = Users.begin(), E = Users.end(); - U != E; ++U) + U != E; ++U) { + if (IsInPair.find(*U) == IsInPair.end()) continue; PairableInstUsers.insert(ValuePair(I, *U)); + } } } -- 2.7.4