[Mlir-commits] [mlir] [MLIR] Change getBackwardSlice to return a logicalresult rather than … (PR #140961)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed May 21 14:38:05 PDT 2025


================
@@ -41,7 +41,8 @@ static LogicalResult createBackwardSliceFunction(Operation *op,
   options.omitBlockArguments = omitBlockArguments;
   // TODO: Make this default.
   options.omitUsesFromAbove = false;
-  getBackwardSlice(op, &slice, options);
+  auto result = getBackwardSlice(op, &slice, options);
+  assert(result.succeeded());
----------------
ftynse wrote:

```suggestion
  LogicalResult result = getBackwardSlice(op, &slice, options);
  assert(result.succeeded() && "expected a backward slice");
```

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


More information about the Mlir-commits mailing list