[PATCH] D79408: [mlir] Harden verifiers for DMA ops

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 05:21:00 PDT 2020


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

DMA operation classes in the Standard dialect (`DmaStartOp` and `DmaWaitOp`)
provide helper functions that make numerous assumptions about the number and
order of operands, and about their types. However, these assumptions were not
checked in the verifier, leading to assertion failures or crashes when helper
functions were used on ill-formed ops. Some of the assuptions were checked in
the custom parser (and thus could not check assumption violations in ops
constructed programmatically, e.g., during rewrites) and others were not
checked at all. Introduce the verifiers for all these assumptions and drop
unnecessary checks in the parser that are now covered by the verifier.

Addresses PR45560.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79408

Files:
  mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
  mlir/lib/Dialect/StandardOps/IR/Ops.cpp
  mlir/test/IR/invalid-ops.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79408.262071.patch
Type: text/x-patch
Size: 12585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200505/0c425f44/attachment.bin>


More information about the llvm-commits mailing list