Files
clang-p2996/mlir/test/Analysis/DataFlow/test-last-modified-error.mlir
Ivan Butygin 15e915a44f [mlir][dataflow] Propagate errors from visitOperation (#105448)
Base `DataFlowAnalysis::visit` returns `LogicalResult`, but wrappers's
Sparse/Dense/Forward/Backward `visitOperation` doesn't.

Sometimes it's needed to abort solver early if some unrecoverable
condition detected inside analysis.

Update `visitOperation` to return `LogicalResult` and propagate it to
`solver.initializeAndRun()`. Only `visitOperation` is updated for now,
it's possible to update other hooks like `visitNonControlFlowArguments`,
bit it's not needed immediately and let's keep this PR small.

Hijacked `UnderlyingValueAnalysis` test analysis to test it.
2024-08-22 12:16:03 +03:00

9 lines
248 B
MLIR

// RUN: not mlir-opt -test-last-modified %s 2>&1 | FileCheck %s
// test error propagation from UnderlyingValueAnalysis::visitOperation
// CHECK: this op is always fails
func.func @test() {
%c0 = arith.constant { always_fail } 0 : i32
return
}