[PATCH] D124750: [MLIR] Add a utility to sort the operands of commutative ops
Srishti Srivastava via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 21 03:50:45 PDT 2022
srishti-pm marked an inline comment as done.
srishti-pm added inline comments.
================
Comment at: mlir/lib/Transforms/Utils/CommutativityUtils.cpp:110
+ /// operand at a particular point in time.
+ DenseSet<Operation *> visitedAncestors;
+
----------------
Mogball wrote:
> Since this is a set of pointers expected to be small, you can use `SmallPtrSet` for a big efficiency boost (linear scan instead of hashing when small).
This set isn't expected to be small, right? There can be many ancestors. The only thing that is small in this context is the number of operands, right?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124750/new/
https://reviews.llvm.org/D124750
More information about the cfe-commits
mailing list