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.
9 lines
248 B
MLIR
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
|
|
}
|