Fixes #60213 https://github.com/llvm/llvm-project/issues/60213
When region is empty, getBodyBlock should return nullptr.
And transform::SequenceOp::getEffects should not use the nullptr return from getBodyBlock.
Details
- Reviewers
ftynse nicolasvasilache springerm
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/test/IR/visitors.mlir | ||
---|---|---|
214 | I don't this a change to the Transform dialect should be affecting test/IR/, which is really for core IR features. I understand this is how the buggy behavior was exposed originally, but we need to find a more suitable place. One trivial solution would be to just have this part of test under test/Dialect/Transform. We may also want to specifically exercise the memory effects rather than the visitor that feels a bit orthogonal. |
mlir/test/IR/visitors.mlir | ||
---|---|---|
214 | Is it OK to add an unit test for getBodyBlock on empty region to return nullptr? And I saw many calls on getBodyBlock which assume it not return nullptr, shall I add check for all the calls of getBodyBlock? |
I don't this a change to the Transform dialect should be affecting test/IR/, which is really for core IR features. I understand this is how the buggy behavior was exposed originally, but we need to find a more suitable place. One trivial solution would be to just have this part of test under test/Dialect/Transform. We may also want to specifically exercise the memory effects rather than the visitor that feels a bit orthogonal.