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

Wenju He via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 19:55:41 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
----------------
wenju-he wrote:

https://llvm.org/docs/CodingStandards.html says `llvm::DenseMap should almost always be used instead of std::map`, shall I change it to DenseMap?

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


More information about the llvm-commits mailing list