llvm-capstone/mlir
Nicolas Vasilache 04ba475e85
[mlir][Vector] Add a rewrite pattern for better low-precision ext(bit… (#66648)
…cast) expansion

This revision adds a rewrite for sequences of vector `ext(bitcast)` to
use a more efficient sequence of vector operations comprising `shuffle`
and `bitwise` ops.

Such patterns appear naturally when writing quantization /
dequantization functionality with the vector dialect.

The rewrite performs a simple enumeration of each of the bits in the
result vector and determines its provenance in the source vector. The
enumeration is used to generate the proper sequence of `shuffle`,
`andi`, `ori` with shifts`.

The rewrite currently only applies to 1-D non-scalable vectors and bails
out if the final vector element type is not a multiple of 8. This is a
failsafe heuristic determined empirically: if the resulting type is not
an even number of bytes, further complexities arise that are not
improved by this pattern: the heavy lifting still needs to be done by
LLVM.
2023-09-18 19:02:46 +02:00
..
benchmark/python [NFC][Py Reformat] Reformat python files in mlir subdir 2023-05-26 08:05:40 +02:00
cmake/modules [mlir][python bindings] generate all the enums 2023-08-23 15:03:55 -05:00
docs [mlir][bufferization] Remove allow-return-allocs and create-deallocs pass options, remove bufferization.escape attribute (#66619) 2023-09-18 16:44:48 +02:00
examples [mlir] Move FunctionInterfaces to Interfaces directory and inherit from CallableOpInterface 2023-08-31 11:28:23 +00:00
include [mlir][Vector] Add a rewrite pattern for better low-precision ext(bit… (#66648) 2023-09-18 19:02:46 +02:00
lib [mlir][Vector] Add a rewrite pattern for better low-precision ext(bit… (#66648) 2023-09-18 19:02:46 +02:00
python [mlir][bufferization] Remove allow-return-allocs and create-deallocs pass options, remove bufferization.escape attribute (#66619) 2023-09-18 16:44:48 +02:00
test [mlir][Vector] Add a rewrite pattern for better low-precision ext(bit… (#66648) 2023-09-18 19:02:46 +02:00
tools [mlir] Split up VectorToLLVM pass 2023-09-13 16:09:56 +00:00
unittests [MLIR] Allow comparison of opaque properties (#66378) 2023-09-17 23:46:31 -07:00
utils [mlir][arith] Rename operations: maxfmaximumf, minfminimumf (#65800) 2023-09-11 22:02:19 -07:00
.clang-format
.clang-tidy
CMakeLists.txt [mlir][gpu] Deprecate gpu::Serialization* passes. (#65857) 2023-09-11 16:32:15 -04:00
LICENSE.TXT
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.