[PATCH] D30869: [JumpThread] In case all predecessor go to a single successor of current BB. We want to fold (not thread).

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 11 16:18:11 PST 2017


dberlin added inline comments.


================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:1273
+    if (PredToDestList.size() ==
+        (unsigned)std::distance(pred_begin(BB), pred_end(BB))) {
+      for (auto *SuccBB : make_range(succ_begin(BB), succ_end(BB))) {
----------------
majnemer wrote:
> I'd use `size_t` instead of `unsigned` here.
If you are going to check predecessors a bunch, please use the prediteratorcache to cache the size.
This is not a cheap operation.



https://reviews.llvm.org/D30869





More information about the llvm-commits mailing list