[Mlir-commits] [mlir] [mlir-c] Add slice analysis and topological sort (PR #206550)
Maksim Levental
llvmlistbot at llvm.org
Tue Sep 22 16:50:15 PDT 2026
================
@@ -0,0 +1,94 @@
+//===- Analysis.cpp - C API for MLIR Analysis Utilities -------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir-c/Analysis.h"
+
+#include "mlir/Analysis/SliceAnalysis.h"
+#include "mlir/Analysis/TopologicalSortUtils.h"
+#include "mlir/CAPI/IR.h"
+#include "mlir/CAPI/Support.h"
+
+using namespace mlir;
+
+static SetVector<Operation *> computeForwardSlice(
+ MlirOperation op, MlirSliceFilterCallback filter, void *filterUserData) {
+ SetVector<Operation *> result;
+ ForwardSliceOptions options;
+ if (filter)
+ options.filter = [filter, filterUserData](Operation *op) {
+ return filter(wrap(op), filterUserData);
+ };
----------------
makslevental wrote:
conditional needs braces
https://github.com/llvm/llvm-project/pull/206550
More information about the Mlir-commits
mailing list