[mlir] Update LICM to support Graph Regions
authorMogball <jeffniu22@gmail.com>
Tue, 12 Apr 2022 00:50:20 +0000 (00:50 +0000)
committerMogball <jeffniu22@gmail.com>
Fri, 15 Apr 2022 17:30:27 +0000 (17:30 +0000)
commit3430ae1e7baa11992084e3624eb28f9dfd941ec7
tree6e803d0fd5987f13099ca81881b65786f622c5e7
parent04e094a33629e97d4ec51db4d5ca56066d82b030
[mlir] Update LICM to support Graph Regions

Changes the algorithm of LICM to support graph regions (no guarantee of topologically sorted order). Also fixes an issue where ops with recursive side effects and regions would not be hoisted if any nested ops used operands that were defined within the nested region.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D122465
mlir/lib/Interfaces/LoopLikeInterface.cpp
mlir/test/Transforms/loop-invariant-code-motion.mlir
mlir/test/lib/Dialect/Test/TestOps.td