BBVectorize: Omit unnecessary entries in PairableInstUsers
authorHal Finkel <hfinkel@anl.gov>
Mon, 11 Feb 2013 23:02:09 +0000 (23:02 +0000)
committerHal Finkel <hfinkel@anl.gov>
Mon, 11 Feb 2013 23:02:09 +0000 (23:02 +0000)
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

index bf8fca0..b14d91d 100644 (file)
@@ -1390,8 +1390,10 @@ namespace {
         (void) trackUsesOfI(Users, WriteSet, I, J);
 
       for (DenseSet<Value *>::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));
+      }
     }
   }