[mlir] Fix infinite loop in collapse
authorGuray Ozen <guray.ozen@gmail.com>
Fri, 2 Dec 2022 15:34:58 +0000 (16:34 +0100)
committerGuray Ozen <guray.ozen@gmail.com>
Mon, 5 Dec 2022 11:57:20 +0000 (12:57 +0100)
commit12cc8e7310474c2b3231e4ebba8e555e31cd3eaf
tree3fd42a290f6cce1805788424ebc78bff55fe8376
parentb0f78769178ebb5e0691aca5143fead7f79ee55c
[mlir] Fix infinite loop in collapse

Incrementing `counter` variable is inside the if statement. If the code does not enter there, the while loop will iterate infinitely. This revision moves the codes outside of if statement.

Reviewed By: mravishankar

Differential Revision: https://reviews.llvm.org/D139005
mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp