[MLIR][Linalg] Generalize splat constant folding
authorFrederik Gossen <frgossen@google.com>
Mon, 26 Apr 2021 15:37:15 +0000 (17:37 +0200)
committerFrederik Gossen <frgossen@google.com>
Tue, 27 Apr 2021 07:08:34 +0000 (09:08 +0200)
commitb003ebd603c9b16ad65527f89c1a9898598ce6ff
treeab10f9c3c27393d662c383668d9878c9f8a3e0d5
parent3a3fbbe21720839e8ad9f7eb70db7b0b7cda1c4f
[MLIR][Linalg] Generalize splat constant folding

Splat constant folding was limited to `std.constant` operations. Instead, use
the constant matcher and apply splat constant folding to any constant-like
operation that holds a splat attribute.

Differential Revision: https://reviews.llvm.org/D101301
mlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp