[mlir][Linalg] Refactor Linalg vectorization for better reuse and extensibility.
This revision unifies Linalg vectorization and paves the way for vectorization of Linalg ops with mixed-precision operations. The new algorithm traverses the ops in the linalg block in order and avoids recursion. It uses a BlockAndValueMapping to keep track of vectorized operations. The revision makes the following modifications but is otherwise NFC: 1. vector.transfer_read are created eagerly and may appear in a different order than the original order. 2. a more progressive vectorization to vector.contract results in only the multiply operation being converted to `vector.contract %a, %b, %zero`, where `%zero` is a constant of the proper type. Later vector canonicalizations are assumed to rewrite vector.contract %a, %b, %zero + add to a proper accumulate form. Differential revision: https://reviews.llvm.org/D95797
Loading
Please register or sign in to comment