[all-commits] [llvm/llvm-project] 850b2c: [mlir] Fix `Region`s `takeBody` method if the regi...
zero9178 via All-commits
all-commits at lists.llvm.org
Thu Apr 21 06:33:15 PDT 2022
Author: Markus Böck <markus.boeck02 at gmail.com>
Date: 2022-04-21 (Thu, 21 Apr 2022)
[mlir] Fix `Region`s `takeBody` method if the region is not empty
The current implementation of takeBody first clears the Region, before then taking ownership of the blocks of the other regions. The issue here however, is that when clearing the region, it does not take into account references of operations to each other. In particular, blocks are deleted from front to back, and operations within a block are very likely to be deleted despite still having uses, causing an assertion to trigger .
This patch fixes that issue by simply calling dropAllReferences()before clearing the blocks.
Differential Revision: https://reviews.llvm.org/D123913
More information about the All-commits