[PATCH] D24805: [GVNSink] Initial GVNSink prototype

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 20:45:49 PDT 2017


dberlin accepted this revision.
dberlin added a comment.
This revision is now accepted and ready to land.

I'm fine with this code from an algorithm perspective.  It may not be perfect, but it's a good start. I haven't gone through it with as strong of a style eye as others may.
It may be worth waiting for someone to do that, but i'm also fine if you want to commit it and do that in post-commit-review, since i have no trouble trusting you'll do that.



================
Comment at: lib/Transforms/Scalar/GVNSink.cpp:75
+
+/// Iterates through instructions in a set of blocks in reverse order from the
+/// first non-terminator. For example (assume all blocks have size n):
----------------
I'm not sure how easy/possible it is to do, but isn't this just a zip_iterator of a bunch of reverse iterators?



================
Comment at: lib/Transforms/Scalar/GVNSink.cpp:198
+      Blocks.push_back(PN->getIncomingBlock(I));
+    std::stable_sort(Blocks.begin(), Blocks.end());
+
----------------
I'm curious why you think you need stable sort here as opposed to regular



Repository:
  rL LLVM

https://reviews.llvm.org/D24805





More information about the llvm-commits mailing list