aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/DFAPacketizer.cpp
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2022-06-28 11:29:27 +0000
committerMehdi Amini <joker.eph@gmail.com>2022-06-28 12:08:25 +0000
commit508eb41d82ca956c30950d9a16b522a29aeeb333 (patch)
treec8f7ea51c5faeec1e87807d8391fd38d0255b3c6 /llvm/lib/CodeGen/DFAPacketizer.cpp
parent88b6d22791991d14bbf1fcd7d55e61507b1b2891 (diff)
downloadllvm-508eb41d82ca956c30950d9a16b522a29aeeb333.zip
llvm-508eb41d82ca956c30950d9a16b522a29aeeb333.tar.gz
llvm-508eb41d82ca956c30950d9a16b522a29aeeb333.tar.bz2
Introduce a new Dense Array attribute
This attribute is similar to DenseElementsAttr but does not support splat. As such it has a much simpler API and does not need any smart iterator: it exposes direct ArrayRef access. A new syntax is introduced so that the generic printing/parsing looks like: [:i64 1, -2, 3] This attribute beings like an ArrayAttr but has a `:` token after the opening square brace to introduce the element type (supported are I8, I16, I32, I64, F32, F64) and the comma separated list for the data. This is particularly convenient for attributes intended to be small, like those referring to shapes. For example a `transpose` operation with a `dims` attribute could be defined as such: let arguments = (ins AnyTensor:$input, DenseI64ArrayAttr:$dims); let assemblyFormat = "$input `dims` `=` $dims attr-dict : type($input)"; And printed this way (the element type is elided in this case): transpose %input dims = [0, 2, 1] : tensor<2x3x4xf32> The C++ API for dims would just directly return an ArrayRef<int64> RFC: https://discourse.llvm.org/t/rfc-introduce-a-new-dense-array-attribute/63279 Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D123774
Diffstat (limited to 'llvm/lib/CodeGen/DFAPacketizer.cpp')
0 files changed, 0 insertions, 0 deletions