aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
diff options
context:
space:
mode:
authorNicolas Vasilache <nicolasvasilache@users.noreply.github.com>2023-09-18 15:08:18 +0200
committerGitHub <noreply@github.com>2023-09-18 15:08:18 +0200
commitbf7c490ab73a22620c3d7790c09bfb11b669e51b (patch)
treecaf99be4c16233ac9868f439e37bf123cc335704 /llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
parentb8f64431eaf750941490f8fb155b597d618d71a7 (diff)
downloadllvm-bf7c490ab73a22620c3d7790c09bfb11b669e51b.zip
llvm-bf7c490ab73a22620c3d7790c09bfb11b669e51b.tar.gz
llvm-bf7c490ab73a22620c3d7790c09bfb11b669e51b.tar.bz2
[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.
Diffstat (limited to 'llvm/lib/ProfileData/Coverage/CoverageMapping.cpp')
0 files changed, 0 insertions, 0 deletions