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

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 22:37:34 PDT 2016


majnemer added a subscriber: majnemer.

================
Comment at: lib/Analysis/CodeMetrics.cpp:32-33
@@ +31,4 @@
+appendSpeculatableOperands(const Value *V,
+                           SmallPtrSetImpl<const Value *> &Visited,
+                           SmallVectorImpl<const Value *> &Worklist) {
+  const User *U = dyn_cast<User>(V);
----------------
I think you could use a `SetVector` here because you never pop from `Worklist`, right?

================
Comment at: lib/Analysis/CodeMetrics.cpp:34
@@ +33,3 @@
+                           SmallVectorImpl<const Value *> &Worklist) {
+  const User *U = dyn_cast<User>(V);
+  if (!U)
----------------
`const auto *`?


https://reviews.llvm.org/D23396





More information about the llvm-commits mailing list