Closed ThomasRaoux closed 17 hours ago
@antiagainst Like we discussed in PR 4493, the fundamental issue is because of mlir::getBackwardSlice() not handling dependencies in nested op regions. Interestingly, mlir::getForwardSlice() does this correctly. I did not immediately follow-up on the suggestions in 4493 because I saw that [PR 4481] (https://github.com/triton-lang/triton/pull/4881) was removing the dependency. I have it in my backlog to submit an upstream mlir PR to add an option to mlir::getBackwardSlice to handle nested regions. I can prioritize that if PR 4481 won't be unreverted soon.
The pass was reordering scf.if operations without checking the extra dependencies coming from the region. For now just prevent this case although this part of the code might still be fragile.