[all-commits] [llvm/llvm-project] 2affcd: [MLIR] Fix affine fusion bug/efficiency issue / en...
Uday Bondhugula via All-commits
all-commits at lists.llvm.org
Wed May 6 22:31:24 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 2affcd664e6a1cab81dac284110bcf9a010d30b2
https://github.com/llvm/llvm-project/commit/2affcd664e6a1cab81dac284110bcf9a010d30b2
Author: Uday Bondhugula <uday at polymagelabs.com>
Date: 2020-05-07 (Thu, 07 May 2020)
Changed paths:
M mlir/lib/Transforms/LoopFusion.cpp
M mlir/test/Transforms/loop-fusion.mlir
Log Message:
-----------
[MLIR] Fix affine fusion bug/efficiency issue / enable more fusion
The list of destination load ops while evaluating producer-consumer
fusion wasn't being maintained as a set, and as such, duplicate load ops
were being added to it. Although this is harmless correctness-wise, it's
a killer efficiency-wise and it prevents interesting/useful fusions
(including for eg. reshapes into a matmul). The reason the latter
fusions would be missed is that a slice union would be unnecessarily
needed due to the duplicate load ops on a memref added to the 'dst
loads' list. Since slice union is unimplemented for the local var case,
a single destination load op that leads to local vars (like a floordiv /
mod producing fusion), a common case, would not get fused due to an
unnecessary union being tried with itself. (The union would actually be
the same thing but we would bail out.)
Besides the above, this would also significantly speed up fusion as all
the unnecessary slice computations / unions, checks, etc. due to the
duplicates go away.
Differential Revision: https://reviews.llvm.org/D79547
More information about the All-commits
mailing list