Commit c950f78
[Util] Fix intermittent crash in OptimizeIntArithmeticPass (#20637)
We're seeing intermittent failures in 'sharktank_model_tests ::
rocm_hip_w7900' tests on main:
-
https://github.com/iree-org/iree/actions/runs/14600283542/job/40957129060?pr=20601
-
https://github.com/iree-org/iree/actions/runs/14636457142/job/41069048559
-
https://github.com/iree-org/iree/actions/runs/14630167718/job/41051068642
The following issue contains more information on the crash and a
reproducer: #20636
I am not entirely sure whether this PR contains a fix or a workaround.
On one hand, it seems like correctly updating and invalidating all
states manually in the transformations should lead to the same result
without needing to recompute all states. On the other hand, the
`DataFlowSolver` mentions that all analysis states should be erased when
IR changes before a re-run
(https://github.com/llvm/llvm-project/blob/12a31658ea36cda74157c6b4e6b6c031e39a19c0/mlir/include/mlir/Analysis/DataFlowFramework.h#L320):
> /// Steps to re-run a data-flow analysis when IR changes:
/// 1. Erase all analysis states as they are no longer valid.
/// 2. Re-run the analysis using `initializeAndRun`.
Note: I didn't add a test because I don't have a deterministic
reproducer. As the crash is intermittent, the reproducer needs to be run
a large number of times and will fail once in 10-200 runs maybe.
Signed-off-by: Jorn Tuyls <[email protected]>1 parent feba6f7 commit c950f78
File tree
1 file changed
+6
-0
lines changed- compiler/src/iree/compiler/Dialect/Util/Transforms
1 file changed
+6
-0
lines changedLines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
496 | 502 | | |
497 | 503 | | |
498 | 504 | | |
| |||
0 commit comments