[llvm] [DominanceFrontier] make iterating dereferenced DominanceFrontierBase::find deterministic (PR #69711)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 19:51:28 PDT 2023


================
@@ -39,7 +39,9 @@ class raw_ostream;
 template <class BlockT, bool IsPostDom>
 class DominanceFrontierBase {
 public:
-  using DomSetType = std::set<BlockT *>;                // Dom set for a bb
+  // Dom set for a bb. Use SetVector to make iterating dom frontiers of a bb
+  // deterministic.
+  using DomSetType = SetVector<BlockT *>;
   using DomSetMapType = std::map<BlockT *, DomSetType>; // Dom set map
----------------
kuhar wrote:

Separately from this PR, I wonder if we should use `DenseMap` here.

https://github.com/llvm/llvm-project/pull/69711


More information about the llvm-commits mailing list