[PATCH] D48026: [ScopHelper] Provide support for recognising collective invariant loads

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 22 03:15:05 PDT 2018


philip.pfaffe added inline comments.


================
Comment at: lib/Support/ScopHelper.cpp:455
+      auto *lt = dyn_cast<LoadInst>(prev_inst);
+      for (int i = 0; i < RequiredILS.size(); i++)
+        if (RequiredILS[i] == lt)
----------------
Meinersbur wrote:
> [style] Use a C++ foreach or a standard library function.
Why are you looping at all? This is a RequiredILS is a set, just call O(1) `count()`.


https://reviews.llvm.org/D48026





More information about the llvm-commits mailing list