[PATCH] D29678: [Tablegen/DAG Debug] - Instrumenting table gen DAGGenISelDAG to allow printing selected patterns(and their sources) during ISEL

Ahmed Bougacha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 10:00:08 PST 2017


ab added inline comments.


================
Comment at: utils/TableGen/DAGISelMatcherEmitter.cpp:68
+    auto It =
+        std::find(VecPatternsCovered.begin(), VecPatternsCovered.end(), P);
+    if (It == VecPatternsCovered.end()) {
----------------
dsanders wrote:
> ab wrote:
> > While this isn't a huge deal (because it's a debug feature), the complexity of std::find makes me twitchy.
> > 
> > Maybe use a UniqueVector or std::lower_bound?
> Do we really need to de-dupe them? I wouldn't expect there to be duplicates since this indicates redundant patterns in the tablegen files and the MatcherTable entries for one of them will be unreachable.
You're absolutely right, seems like this should just be a vector.


Repository:
  rL LLVM

https://reviews.llvm.org/D29678





More information about the llvm-commits mailing list