[MLIR] Simplify affine.if ops with trivial conditions
authorShashij gupta <shashij.gupta@polymagelabs.com>
Sat, 12 Jun 2021 13:58:40 +0000 (19:28 +0530)
committerUday Bondhugula <uday@polymagelabs.com>
Sat, 12 Jun 2021 13:59:10 +0000 (19:29 +0530)
commit466e5aba6495644eb8ba84c3e7f07bf802ff84f0
treec3c52e5d8b5cc761e263f09da356e13884a23c31
parentb4583a5ad73b633c3eac5ffbad93f2405e1418ab
[MLIR] Simplify affine.if ops with trivial conditions

The commit simplifies affine.if ops :
The affine if operation gets removed if the condition is universally true or false and then/else block is merged with the parent block.

Signed-off-by: Shashij Gupta shashij.gupta@polymagelabs.com
Reviewed By: bondhugula, pr4tgpt

Differential Revision: https://reviews.llvm.org/D104015
mlir/lib/Dialect/Affine/IR/AffineOps.cpp
mlir/test/Dialect/Affine/loop-unswitch.mlir
mlir/test/Dialect/Affine/simplify-affine-structures.mlir