[MLIR] Fix incorrect removal of source loop in loop fusion
authorGroverkss <groverkss@gmail.com>
Mon, 22 Nov 2021 21:18:03 +0000 (02:48 +0530)
committerGroverkss <groverkss@gmail.com>
Mon, 22 Nov 2021 21:24:09 +0000 (02:54 +0530)
commit98daa4e425b02a0c27d53992e80510bda65809c5
tree85fca7f1d9b38657b7151fef61785061575b7800
parent2975f37d8d4ffb8fd2b0950d6851c5fab93b4a19
[MLIR] Fix incorrect removal of source loop in loop fusion

This patch fixes a bug in loop fusion pass where the source loop was removed
even when the fused loop did not cover all iterations of the source loop.

This was because the fast hueristic check for checking if source loop and
fused loop have same iterations did not take into account steps in loop.

Reviewed By: dcaballe, bondhugula

Differential Revision: https://reviews.llvm.org/D114164
mlir/lib/Analysis/Utils.cpp
mlir/test/Transforms/loop-fusion-4.mlir