llvm-capstone/mlir
Nicolas Vasilache bf7c490ab7
[mlir][Vector] Add a rewrite pattern for better low-precision bitcast… (#66387)
…(trunci) expansion

This revision adds a rewrite for sequences of vector `bitcast(trunci)`
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 pre-trunci vector.
The enumeration is used to generate the proper sequence of `shuffle`,
`andi`, `ori` followed by an optional final `trunci`/`extui`.

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 15:08:18 +02:00
..
benchmark/python
cmake/modules
docs [mlir][bufferization] Add an ownership based buffer deallocation pass (#66337) 2023-09-14 12:13:37 +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 bitcast… (#66387) 2023-09-18 15:08:18 +02:00
lib [mlir][Vector] Add a rewrite pattern for better low-precision bitcast… (#66387) 2023-09-18 15:08:18 +02:00
python [mlir][transform][lingalg][python] Replace pdl.operation => transform.any_op. (#66392) 2023-09-15 09:06:07 +02:00
test [mlir][Vector] Add a rewrite pattern for better low-precision bitcast… (#66387) 2023-09-18 15:08:18 +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.