[PATCH] D37957: [TableGen] Some simple optimizations to TableGen execution time
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 20 11:29:12 PDT 2017
rnk added a comment.
lgtm, just nits
================
Comment at: llvm/include/llvm/ADT/DenseSet.h:192
+ bool operator==(const DenseSetImpl<ValueT, MapTy, ValueInfoT> &Other) const {
+ if (size() != Other.size())
----------------
What made us need this?
================
Comment at: llvm/include/llvm/ADT/DenseSet.h:196
+ for (const auto &I : *this)
+ if (Other.find(I) == Other.end())
+ return false;
----------------
Is this simpler as:
if (!Other.count(I))
return false;
================
Comment at: llvm/utils/TableGen/CodeGenDAGPatterns.cpp:20
#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/Twine.h"
----------------
You only use StringMap, not StringSet, so include that header.
================
Comment at: llvm/utils/TableGen/CodeGenDAGPatterns.h:21
#include "CodeGenTarget.h"
+#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallVector.h"
----------------
zturner wrote:
> kparzysz wrote:
> > This should go in the .cpp file (I don't see any uses of DenseSet in the header).
> It's needed here in order to specialize the `DenseMapInfo`
Include DenseMapInfo.h directly, then.
Repository:
rL LLVM
https://reviews.llvm.org/D37957
More information about the llvm-commits
mailing list