[InstSimplify] Fold away ord/uno fcmps when nnan is present.
[oota-llvm.git] / include / llvm / Analysis / DominanceFrontierImpl.h
index c56eb4d3bdf5d4c0502da340992836bc22049308..629ae3809045720ed4908715a9fcf232eb1c8e3c 100644 (file)
 #define LLVM_ANALYSIS_DOMINANCEFRONTIERIMPL_H
 
 #include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/Analysis/DominanceFrontier.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/GenericDomTree.h"
 
 namespace llvm {
 
-namespace {
 template <class BlockT>
 class DFCalculateWorkObject {
 public:
@@ -37,7 +38,6 @@ public:
   const DomTreeNodeT *Node;
   const DomTreeNodeT *parentNode;
 };
-}
 
 template <class BlockT>
 void DominanceFrontierBase<BlockT>::removeBlock(BlockT *BB) {
@@ -172,9 +172,7 @@ ForwardDominanceFrontierBase<BlockT>::calculate(const DomTreeT &DT,
     DomSetType &S = this->Frontiers[currentBB];
 
     // Visit each block only once.
-    if (visited.count(currentBB) == 0) {
-      visited.insert(currentBB);
-
+    if (visited.insert(currentBB).second) {
       // Loop over CFG successors to calculate DFlocal[currentNode]
       for (auto SI = BlockTraits::child_begin(currentBB),
                 SE = BlockTraits::child_end(currentBB);