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

Xin Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 16:05:30 PDT 2017


trentxintong added a comment.

Gentle Ping.



================
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))) {
----------------
trentxintong wrote:
> dberlin wrote:
> > 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.
> > 
> I think thats a good suggestion. There are a few places we get the predecessors of the block currently being processed, we could use a PredIterCache for them. But I prefer to put it in as another commit.
dberlin is doing experiment about preditercache. I will rewrite this part if needed  when that is done in another commit.


https://reviews.llvm.org/D30869





More information about the llvm-commits mailing list