[PATCH] D75837: [MLIR] Introduce scf.execute_region op

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 9 09:36:14 PDT 2021


mehdi_amini added inline comments.


================
Comment at: mlir/include/mlir/Dialect/SCF/SCFOps.td:114
+  // inline.
+  let hasCanonicalizer = 0;
+
----------------
bondhugula wrote:
> mehdi_amini wrote:
> > Seems like a canonicalization could be that it would return an SSA value defined in the enclosing region.
> Did you mean moving the slice that generates the yield values to the enclosing region (if they were inside the scf.execute_region)? This can't be done in O(1) time in general nor are the utilities that allow one to do that available in IR libraries - can be part of `Transforms/` though.
I mean that if you have:

```
%value = ...
%execute_results:2 = scf.execute_region {
  ...
  %x = ...
   ...
  scf.yield %x, %value
}
```

Here `%execute_results#1` can be RAUW with `%value` and the code turned to:

```
%value = ...
%execute_results = scf.execute_region {
  ...
  %x = ...
   ...
  scf.yield %x
}
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75837/new/

https://reviews.llvm.org/D75837



More information about the llvm-commits mailing list