================
@@ -6,10 +6,34 @@
//
//===----------------------------------------------------------------------===//
-#include "CIRTransformUtils.h"
+#include "clang/CIR/Dialect/Transforms/CIRTransformUtils.h"
#include "clang/CIR/Dialect/IR/CIRTypes.h"
+#include "llvm/ADT/DepthFirstIterator.h"
+
+void cir::collectUnreachable(mlir::Operation *parent,
+ llvm::SmallVectorImpl<mlir::Operation *> &ops) {
+ // For every region under `parent`, find the blocks unreachable from the
+ // entry via a forward CFG traversal and collect their ops.
+ llvm::df_iterator_default_set<mlir::Block *, 16> reachable;
----------------
erichkeane wrote:
It seems we insta-clear this on line 25. Can we just put the construction of
this on line 25?
https://github.com/llvm/llvm-project/pull/197334
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits