[PATCH] D79296: [mlir][DenseElementsAttr] Add support for opaque APFloat/APInt complex values.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 2 14:50:50 PDT 2020


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

This revision allows for creating DenseElementsAttrs and accessing elements using std::complex<APInt>/std::complex<APFloat>. This allows for opaquely accessing and transforming complex values. This is used by the printer/parser to provide pretty printing for complex values. The form for complex values matches that of std::complex, i.e.:

  // `(` element `,` element `)`
  dense<(10,10)> : tensor<complex<i64>>

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79296

Files:
  mlir/include/mlir/IR/Attributes.h
  mlir/lib/IR/AsmPrinter.cpp
  mlir/lib/IR/AttributeDetail.h
  mlir/lib/IR/Attributes.cpp
  mlir/lib/Parser/Parser.cpp
  mlir/test/IR/dense-elements-hex.mlir
  mlir/test/IR/invalid.mlir
  mlir/test/IR/parser.mlir
  mlir/unittests/IR/AttributeTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79296.261666.patch
Type: text/x-patch
Size: 38404 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200502/9934c7d5/attachment.bin>


More information about the llvm-commits mailing list