[all-commits] [llvm/llvm-project] 8c2ea1: [mlir][vector] Fold scalar vector.extract of non-s...

Jakub Kuderski via All-commits all-commits at lists.llvm.org
Tue Sep 13 17:31:36 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c2ea14436c8232fa2e496122cb1d9349b1d8737
      https://github.com/llvm/llvm-project/commit/8c2ea14436c8232fa2e496122cb1d9349b1d8737
  Author: Jakub Kuderski <kubak at google.com>
  Date:   2022-09-13 (Tue, 13 Sep 2022)

  Changed paths:
    M mlir/lib/Dialect/Vector/IR/VectorOps.cpp
    M mlir/test/Dialect/Vector/canonicalize.mlir

  Log Message:
  -----------
  [mlir][vector] Fold scalar vector.extract of non-splat n-D constants

Add a new pattern to fold `vector.extract` over n-D constants that extract scalars.
The previous code handled ND splat constants only. The new pattern is conservative and does handle sub-vector constants.

This is to aid the `arith::EmulateWideInt` pass which emits a lot of 2-element vector constants.

Reviewed By: Mogball, dcaballe

Differential Revision: https://reviews.llvm.org/D133742




More information about the All-commits mailing list