llvm-project/mlir/lib
Nicolas Vasilache f202d32216 [mlir][SCF] Add canonicalization pattern for scf::For to eliminate yields that just forward.
For instance:
```
func @for_yields_3(%lb : index, %ub : index, %step : index) -> (i32, i32, i32) {
  %a = call @make_i32() : () -> (i32)
  %b = call @make_i32() : () -> (i32)
  %r:3 = scf.for %i = %lb to %ub step %step iter_args(%0 = %a, %1 = %a, %2 = %b) -> (i32, i32, i32) {
    %c = call @make_i32() : () -> (i32)
    scf.yield %0, %c, %2 : i32, i32, i32
  }
  return %r#0, %r#1, %r#2 : i32, i32, i32
}
```

Canonicalizes as:
```
  func @for_yields_3(%arg0: index, %arg1: index, %arg2: index) -> (i32, i32, i32) {
    %0 = call @make_i32() : () -> i32
    %1 = call @make_i32() : () -> i32
    %2 = scf.for %arg3 = %arg0 to %arg1 step %arg2 iter_args(%arg4 = %0) -> (i32) {
      %3 = call @make_i32() : () -> i32
      scf.yield %3 : i32
    }
    return %0, %2, %1 : i32, i32, i32
  }
```

Differential Revision: https://reviews.llvm.org/D90745
2020-11-04 11:36:27 +00:00
..
Analysis Revert "[MLIR] Support walks over regions and blocks" 2020-11-02 16:21:29 +00:00
Bindings [mlir][Python] Return and accept OpView for all functions. 2020-11-03 22:48:34 -08:00
CAPI [mlir] Fix failing shared libraries build 2020-11-04 10:35:17 +00:00
Conversion [mlir] Add a simpler lowering pattern for WhileOp representing a do-while loop 2020-11-04 09:43:13 +01:00
Dialect [mlir][SCF] Add canonicalization pattern for scf::For to eliminate yields that just forward. 2020-11-04 11:36:27 +00:00
EDSC Remove MLIREDSCInterface library which isn't used anywhere (NFC) 2020-08-18 19:04:30 +00:00
ExecutionEngine [mlir] JitRunner: add a config option to register symbols with ExecutionEngine at runtime 2020-10-27 15:57:34 -07:00
IR [MLIR] Check for duplicate entries in attribute dictionary during custom parsing 2020-11-03 16:40:46 -08:00
Interfaces [mlir] Add a generic while/do-while loop to the SCF dialect 2020-11-04 09:43:13 +01:00
Parser [mlir] Add a generic while/do-while loop to the SCF dialect 2020-11-04 09:43:13 +01:00
Pass Make the implicit nesting behavior of the PassManager user-controllable and default to false 2020-11-03 11:17:44 +00:00
Reducer [mlir] NFC: fix trivial typos 2020-10-29 04:05:22 +09:00
Rewrite [mlir][Pattern] Add a new FrozenRewritePatternList class 2020-10-26 18:01:06 -07:00
Support Make the implicit nesting behavior of the PassManager user-controllable and default to false 2020-11-03 11:17:44 +00:00
TableGen [mlir] NFC: fix trivial typos 2020-10-29 04:05:22 +09:00
Target [MLIR] NFC : Move OpenMP dialect include to translation 2020-11-03 22:12:10 +00:00
Transforms Change the PrintOpStatsPass to operate on any operation instead of just ModuleOp 2020-11-03 11:15:32 +00:00
Translation Remove global dialect registration 2020-10-24 00:35:55 +00:00
CMakeLists.txt [mlir][NFC] Move around the code related to PatternRewriting to improve layering 2020-10-26 18:01:06 -07:00