[PATCH] D79281: [mlir][DenseElementsAttr] Add support for ComplexType elements

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 10:44:10 PDT 2020


rriddle marked 4 inline comments as done.
rriddle added inline comments.


================
Comment at: mlir/lib/IR/AttributeDetail.h:378
+  if (ComplexType complex = eltType.dyn_cast<ComplexType>())
+    return getDenseElementBitWidth(complex.getElementType()) * 2;
   // FIXME(b/121118307): using 64 bits for BF16 because it is currently stored
----------------
jpienaar wrote:
> This is a little bit weird. I see some use C64 to refer to 2x64 bit float complex number while XLA consider std::complex<float> as C64 (so 64 is total).  So seems the bitwidth is overloaded for complex already, as long as you document it this seems fine then as there doesn't seem to be 1 convention.
That is different. We don't suffer from the problematic naming because we explicitly specify the element type. We specify the type exactly the same as C++ complex, i.e. there is no C64 there is only complex<double>/complex<float>/etc. It doesn't seem like there is any ambiguity there?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79281/new/

https://reviews.llvm.org/D79281





More information about the llvm-commits mailing list