[PATCH] D80136: [mlir] Erase or clear blocks through ConversionPatternRewriter when applicable

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 09:09:44 PDT 2020


ftynse created this revision.
ftynse added reviewers: nicolasvasilache, antiagainst, bondhugula.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, bader, Joonsoo, stephenneuendorffer, liufengdb, lucyrfox, mgester, arpith-jacob, csigg, shauheen, jpienaar, rriddle, mehdi_amini.
Herald added a reviewer: mravishankar.
Herald added a reviewer: herhut.
Herald added a project: LLVM.

Multiple places in the code base were erasing Blocks or operations in them
using in-place modifications (`Block::erase` or `Block::clear`) unknown to
ConversionPatternRewriter. These operations could not be undone if the pattern
failed and could lead to inconsistent in-memory state of the IR with dangling
pointers. Use `ConversionPatternRewriter::eraseOp` and `::eraseBlock` instead.

Depends On D80135 <https://reviews.llvm.org/D80135>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80136

Files:
  mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp
  mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp
  mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp
  mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp
  mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp
  mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp
  mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80136.264652.patch
Type: text/x-patch
Size: 4940 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200518/136f5431/attachment.bin>


More information about the llvm-commits mailing list