[PATCH] D23396: [Assumptions] Make collecting ephemeral values not quadratic in the number of assume intrinsics.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 14:49:22 PDT 2016


hfinkel added inline comments.

================
Comment at: lib/Analysis/CodeMetrics.cpp:54
@@ +53,3 @@
+  // worklist forever.
+  for (int i = 0; i < (int)Worklist.size(); ++i) {
+    const Value *V = Worklist[i];
----------------
Is there a reason to use the index here? Why not write this as:

  for (auto I = Worklist.begin(); I != Worklist.end(); ++I) {
    const Value *V = *I;


================
Comment at: lib/Analysis/CodeMetrics.cpp:85
@@ -73,3 +84,3 @@
 
     // Filter out call sites outside of the loop so we don't to a function's
     // worth of work for each of its loops (and, in the common case, ephemeral
----------------
to a -> do a


https://reviews.llvm.org/D23396





More information about the llvm-commits mailing list