[MLIR][Affine][LICM] Mark users of `iter_args` variant
authorVinayaka Bandishti <vinayaka@polymagelabs.com>
Tue, 25 May 2021 09:49:15 +0000 (15:19 +0530)
committerUday Bondhugula <uday@polymagelabs.com>
Tue, 25 May 2021 10:26:52 +0000 (15:56 +0530)
commiteff269fc9f8b8c79e08e8295aa22da8950bcc341
treec6507a3f860adb1299ee50ef84640a47ffaa6f10
parent9ccdc2e23be18eca0b09f055fd17115c0366166c
[MLIR][Affine][LICM] Mark users of `iter_args` variant

Prevent users of `iter_args` of an affine for loop from being hoisted
out of it. Otherwise, LICM leads to a violation of the SSA dominance
(as demonstrated in the added test case).

Fixes: https://bugs.llvm.org/show_bug.cgi?id=50103

Reviewed By: bondhugula, ayzhuang

Differential Revision: https://reviews.llvm.org/D102984
mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
mlir/test/Dialect/Affine/affine-loop-invariant-code-motion.mlir