[all-commits] [llvm/llvm-project] 0a2a26: [mlir][Linalg] Refactor Linalg vectorization for b...

Nicolas Vasilache via All-commits all-commits at lists.llvm.org
Tue Feb 2 03:35:02 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0a2a260aab177bfbdef5829ea16e39323ce50916
      https://github.com/llvm/llvm-project/commit/0a2a260aab177bfbdef5829ea16e39323ce50916
  Author: Nicolas Vasilache <nicolas.vasilache at gmail.com>
  Date:   2021-02-02 (Tue, 02 Feb 2021)

  Changed paths:
    M mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
    M mlir/test/Dialect/Linalg/vectorization.mlir

  Log Message:
  -----------
  [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




More information about the All-commits mailing list