[all-commits] [llvm/llvm-project] 1e17c4: [MLIR] Introduce trait EquiMemRefAndEltTypeOperands

Uday Bondhugula via All-commits all-commits at lists.llvm.org
Fri Nov 5 03:30:13 PDT 2021


  Branch: refs/heads/monolith-mlir
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e17c40c4ce8daf46bf5df28a04d1e9ea5690cb2
      https://github.com/llvm/llvm-project/commit/1e17c40c4ce8daf46bf5df28a04d1e9ea5690cb2
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-22 (Wed, 22 Sep 2021)

  Changed paths:
    M mlir/include/mlir/IR/OpBase.td
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/lib/IR/Operation.cpp

  Log Message:
  -----------
  [MLIR] Introduce trait EquiMemRefAndEltTypeOperands

This trait is used by LHLO ops where the operands and result may either
have operands of the same type or equivalent types where a 0-d memref of
an elemental type is considered equivalent to that elemental type.

TODO: add a test dialect test case here.


  Commit: c6b7f22240229f69af9ebb75d4b7a9b5f1dd0da1
      https://github.com/llvm/llvm-project/commit/c6b7f22240229f69af9ebb75d4b7a9b5f1dd0da1
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-22 (Wed, 22 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/CMakeLists.txt
    A mlir/include/mlir/Dialect/LHLO/CMakeLists.txt
    A mlir/include/mlir/Dialect/LHLO/IR/CMakeLists.txt
    A mlir/include/mlir/Dialect/LHLO/IR/HLOOpsBase.td
    A mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.h
    A mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td
    M mlir/include/mlir/InitAllDialects.h
    M mlir/lib/Dialect/CMakeLists.txt
    A mlir/lib/Dialect/LHLO/CMakeLists.txt
    A mlir/lib/Dialect/LHLO/IR/CMakeLists.txt
    A mlir/lib/Dialect/LHLO/IR/LHLOOps.cc
    A mlir/test/Dialect/LHLO/lhlo_ops.mlir

  Log Message:
  -----------
  [MLIR] Add xla_lhlo dialect from tensorflow

Add xla_lhlo dialect from tensorflow (the version used by the right
branch of the private repo). This commit brings in just the LHLO ops
part of it. So, LHLO transforms or any conversions out of LHLO are not
included. This is to mainly to allow the use of xla_lhlo dialect ops
along with MLIR.  So, the users would be aware of LHLO ops (make use
of its accessors) as the xla_lhlo dialect would be registered. This is a
temporary arrangement before we can migrate to depending on mlir-hlo.
Depending on tensorflow just for xla_lhlo isn't really feasible.


  Commit: 28070f1be700f812dd228e51ecbe1efb3b4a73ea
      https://github.com/llvm/llvm-project/commit/28070f1be700f812dd228e51ecbe1efb3b4a73ea
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-22 (Wed, 22 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.h
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td
    M mlir/include/mlir/InitAllDialects.h
    M mlir/lib/Dialect/LHLO/IR/CMakeLists.txt
    M mlir/lib/Dialect/LHLO/IR/LHLOOps.cc
    M mlir/test/Dialect/LHLO/lhlo_ops.mlir

  Log Message:
  -----------
  xla_lhlo dialect fixes to work with upstream


  Commit: 87b4572a6b574fba930770d0c8c96455d0340809
      https://github.com/llvm/llvm-project/commit/87b4572a6b574fba930770d0c8c96455d0340809
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td

  Log Message:
  -----------
  [MLIR] [NFC] Update xla_lhlo WhileOp documentation

Update xla_lhlo WhileOp documentation. NFC.


  Commit: 7a34031a8fdabe5f484a537c96a7cd31999c51d5
      https://github.com/llvm/llvm-project/commit/7a34031a8fdabe5f484a537c96a7cd31999c51d5
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td
    M mlir/lib/Dialect/LHLO/IR/LHLOOps.cc
    A mlir/test/Dialect/LHLO/invalid.mlir

  Log Message:
  -----------
  [MLIR] Add verifier for LHLO get tuple element op

The LHLO GetTupleElementOp was missing its verifier. Add the verifier.


  Commit: 071e483b072ee7ff59ec3386b6bc0155c7a230b3
      https://github.com/llvm/llvm-project/commit/071e483b072ee7ff59ec3386b6bc0155c7a230b3
  Author: Prateek Gupta <prateek at polymagelabs.com>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td
    M mlir/lib/Dialect/LHLO/IR/LHLOOps.cc
    M mlir/test/Dialect/LHLO/invalid.mlir

  Log Message:
  -----------
  Add verifier for the LHLO TupleOp
Added verification support for LHLO TupleOp, so that inconsistency between input and output types for the LHLO TupleOp can be checked.


  Commit: eff9b542c7e3cbc44faac86046461a982ac9dcdc
      https://github.com/llvm/llvm-project/commit/eff9b542c7e3cbc44faac86046461a982ac9dcdc
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td
    M mlir/test/Dialect/LHLO/lhlo_ops.mlir

  Log Message:
  -----------
  [MLIR] Introduce IfOp in the xla_lhlo dialect

Introduce LHLO IfOp to model conditionals on the memref form.  This is
lowered form form of HLO IfOp (the latter operates on tensors).  Its
design is similar to that of the LHLO WhileOp, taking in tuples of
memrefs or elemental types. The true and the false bodies return a tuple
of the same type.


  Commit: 51de91957abebee3c6fdf870f1388b266ea011b1
      https://github.com/llvm/llvm-project/commit/51de91957abebee3c6fdf870f1388b266ea011b1
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/LHLO/IR/CMakeLists.txt
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.h
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td
    M mlir/include/mlir/InitAllDialects.h
    M mlir/lib/Dialect/LHLO/IR/LHLOOps.cc
    M mlir/test/Dialect/LHLO/invalid.mlir
    M mlir/test/Dialect/LHLO/lhlo_ops.mlir
    M mlir/test/mlir-opt/commandline.mlir

  Log Message:
  -----------
  Rename xla_lhlo dialect and namespace -> lmhlo

This change of name is being done to avoid a clash in the python binding
with the xla_lhlo in Monolith's TensorFlow. While xla_lhlo was moved to
MLIR proper in our branches, Monolith's TensorFlow still has it and its
methods would get called instead of those in MLIR linked in by Monolith.


  Commit: db04767afbea48b62a7a25017e42248a5d83480c
      https://github.com/llvm/llvm-project/commit/db04767afbea48b62a7a25017e42248a5d83480c
  Author: Prashant Kumar <16246821+pashu123 at users.noreply.github.com>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td

  Log Message:
  -----------
  [MLIR] Add the seed attribute for random_uniform ops in lmhlo dialect. (#35)

The `seed` and `seed2` attribute are added to lmhlo dialect in case of
random_uniform ops. The changes are made as a part of hlo-legalize-to-lhlo` pass.


  Commit: 10cf6d43c473449402675de0d06650464f01bc9f
      https://github.com/llvm/llvm-project/commit/10cf6d43c473449402675de0d06650464f01bc9f
  Author: Abhishek Varma <67887857+avarmapml at users.noreply.github.com>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td

  Log Message:
  -----------
  [MLIR] Add RngNormalOp in LHLO dialect (#60)

-- This commit introduces RngNormalOp as part of LHLO dialect.

Signed-off-by: Abhishek Varma <abhishek.varma at polymagelabs.com>


  Commit: 81fe64da18fa4d4c9252b2ddd646f6623e1d1704
      https://github.com/llvm/llvm-project/commit/81fe64da18fa4d4c9252b2ddd646f6623e1d1704
  Author: Uday Bondhugula <Uday Bondhugula uday at polymagelabs.com>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/IR/AffineMap.h
    M mlir/lib/IR/AffineMap.cpp

  Log Message:
  -----------
  [MLIR] Add AffineMap::isPureAffine

Signed-off-by: Uday Bondhugula <Uday Bondhugula uday at polymagelabs.com>


  Commit: eb1aacd495d84384e2d2e4e40c893aebfbd19837
      https://github.com/llvm/llvm-project/commit/eb1aacd495d84384e2d2e4e40c893aebfbd19837
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/IR/AffineMap.h
    M mlir/lib/IR/AsmPrinter.cpp

  Log Message:
  -----------
  [MLIR-LAIR] Custom printing for multi-dim affine index maps

Custom printing for AffineMaps with named SSA values - to aid printing
NGDL accesses.


  Commit: 5a72ea079cde160b044ec7241928bb9520a5ae75
      https://github.com/llvm/llvm-project/commit/5a72ea079cde160b044ec7241928bb9520a5ae75
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-23 (Thu, 23 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/LoopUtils.h
    M mlir/lib/Transforms/Utils/LoopUtils.cpp

  Log Message:
  -----------
  [MLIR] Add method mlir::isPerfectNestRoot

Add method to check if an affine.for op is the root of a nest that is
nested perfectly all the way.


  Commit: 64e8f9dd5cacb266ae38f788feb1c1acfb3475d3
      https://github.com/llvm/llvm-project/commit/64e8f9dd5cacb266ae38f788feb1c1acfb3475d3
  Author: Prateek Gupta <prateek at polymagelabs.com>
  Date:   2021-09-24 (Fri, 24 Sep 2021)

  Changed paths:
    M mlir/include/mlir/InitAllPasses.h
    A mlir/lib/Transforms/AffineCSPipeline.cpp
    M mlir/lib/Transforms/CMakeLists.txt
    A mlir/test/Transforms/affine-cs-pipeline.mlir

  Log Message:
  -----------
  [MLIR] Add affine-cs-pipeline.

This commit introduces affine-cs-pipeline. The pipeline performs maximal
affine loop fusion and memref data flow optimization with
canonicalization between every pass. Relevant test case is also added.

Signed-off-by: Prateek Gupta <prateek at polymagelabs.com>

Changes while porting to upstream:
1. MemRefDataFlowOptPass is now called AffineScalarReplacementPass.
2. Registering the AffineCSPipeline at one place for `mlir-opt`.
3. Unused store elimination is added upstream, and therefore, test case
   that involves an unused store is eliminated.


  Commit: 93821eabadcad11594b6cb46cacd5681981dd119
      https://github.com/llvm/llvm-project/commit/93821eabadcad11594b6cb46cacd5681981dd119
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-27 (Mon, 27 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h

  Log Message:
  -----------
  [MLIR] Expose affine-cs-pipeline


  Commit: 4f5c3045514341cd5e98bc7b84dd05d49ef37cb7
      https://github.com/llvm/llvm-project/commit/4f5c3045514341cd5e98bc7b84dd05d49ef37cb7
  Author: Prateek Gupta <prateek at polymagelabs.com>
  Date:   2021-09-27 (Mon, 27 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Transforms/AffineCSPipeline.cpp
    M mlir/lib/Transforms/LoopFusion.cpp
    A mlir/test/Transforms/affine-cs-pipeline-perfect-nest.mlir

  Log Message:
  -----------
  [MLIR] Add to enforce perfect nests while loop fusion

This commit adds an option to the affine-cs pipeline to enforce perfect
nests while loop fusion. Relevant test cases are also added.

Signed-Off-By: Prateek Gupta <prateek at polymagelabs.com>

Changes while porting to upstream by Vinayaka Bandishti:
1. Remove test case of reduction fusion into pointwise, since this was
being prevented due to an incorrect reason.


  Commit: af7625a9613d882a4769badb652c30982053365f
      https://github.com/llvm/llvm-project/commit/af7625a9613d882a4769badb652c30982053365f
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-27 (Mon, 27 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/lib/Transforms/AffineCSPipeline.cpp

  Log Message:
  -----------
  [MLIR] Expose affine cs pipeline options

Export affine cs pipeline options structure in the passes header file.


  Commit: 23c49444cb1ecb9567c3deaa9ba008fa81fa80de
      https://github.com/llvm/llvm-project/commit/23c49444cb1ecb9567c3deaa9ba008fa81fa80de
  Author: Prateek Gupta <prateek at polymagelabs.com>
  Date:   2021-09-27 (Mon, 27 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/LoopFusionUtils.h
    M mlir/lib/Transforms/LoopFusion.cpp
    M mlir/lib/Transforms/Utils/LoopFusionUtils.cpp
    M mlir/test/Transforms/affine-cs-pipeline-perfect-nest.mlir

  Log Message:
  -----------
  [MLIR] Fix the enforce perfect nest option in the affine-cs-pipeline.

This commit fixes a bug where loop fusion of  perfect nests having
source store depth less than equal to destination load depth resulted in
imperfect loop nests. Relevant test cases are also corrected.

Signed-off-by: Prateek Gupta <prateek at polymagelabs.com>

Changes while porting to upstream:
1. Test case requires updates since affine scalar replacement is
advanced upstream, and simplifies the loop nests further.
2. Changed the logic in perfect nest fusion, to reuse a variable that
stores the depth at which fusion occurs.
3. Preventing reduction into point-wise test case is added back.


  Commit: d51d8973a7181371d0dcd9b6b836aa5d6ab82a63
      https://github.com/llvm/llvm-project/commit/d51d8973a7181371d0dcd9b6b836aa5d6ab82a63
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/lib/Transforms/AffineCSPipeline.cpp

  Log Message:
  -----------
  [MLIR] Update affine cs pipeline API

Update affine cs pipeline API method to not rely on LLVM CL option based
structure.


  Commit: 296f7eef6d795926889fb2f27487b3f47cde5c9d
      https://github.com/llvm/llvm-project/commit/296f7eef6d795926889fb2f27487b3f47cde5c9d
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/lib/Transforms/AffineCSPipeline.cpp
    R mlir/test/Transforms/affine-cs-pipeline-perfect-nest.mlir
    M mlir/test/Transforms/affine-cs-pipeline.mlir

  Log Message:
  -----------
  [MLIR] Set enforce-perfect-nest by default for  affine-cs-pipeline

Set the option enforce-perfect-nest for affine-cs-pipeline to true by
default. Will preserve perfect nests by default. Merge the two test
cases files for affine-cs-pipeline into one: testing for perfect
nestedness should be an integral part of the testing of
affine-cs-pipeline.

Changes while porting to upstream:
1. Test cases now have the comment to check for affine scalar
   replacement, instead of the older name - memref dataflow opt.
2. Test case has edits to account for new simplifications in
   the above pass, that remove a store, if it is not going to be
   used.


  Commit: ad24d8de32526421a9724e1b3efa449bc1e14ba3
      https://github.com/llvm/llvm-project/commit/ad24d8de32526421a9724e1b3efa449bc1e14ba3
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    A mlir/test/Analysis/test-uninitialized-memrefs.mlir
    M mlir/test/lib/Dialect/Affine/CMakeLists.txt
    A mlir/test/lib/Dialect/Affine/TestUninitializedMemRefCheck.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [MLIR] Introduce pass to detect uninitialized memref reads

Introduce a pass (-test-uninitialized-memref-check) to detect
uninitialized memref reads. This pass statically catches memref reads
that are "definitely" (provably) reading/loading from memrefs that have
not been initialized. The pass is aware of lmhlo tuple packing/unpacking
ops, `if`, and `while` ops. The latter two kinds of ops take as input
tuple arguments and return tuple arguments: such arguments themselves
could be holding memrefs which alias with other memrefs.

Changes while porting to upstream:
1. Test case changes `alloc` -> `memref.alloc`.
2. Including `memref` dialect ops like LoadOp.
3. Pass registration has changed.


  Commit: cc7b063eb879ae83320710f28abf9b1428aaf935
      https://github.com/llvm/llvm-project/commit/cc7b063eb879ae83320710f28abf9b1428aaf935
  Author: Vinayaka Bandishti <vinayaka at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Transforms/AffineCSPipeline.cpp
    M mlir/lib/Transforms/LoopFusion.cpp
    M mlir/test/Transforms/affine-cs-pipeline.mlir
    M mlir/test/Transforms/loop-fusion.mlir

  Log Message:
  -----------
  [MLIR] Add option to restrict fusion only in cases that result in a single store (eventually)

Changes here create a new option `single-store` for `affine-cs-pipeline`
that restricts fusion to proceed only if the resulting loop nest will
have a single store (maybe after the `memref-dataflow-opt` runs. Current
assumption is that loop nests contain point-wise operations, and a
formal check to verify this is not yet implemented.

During the fusion pass, changes will:

1. Avoid sibling strategy (not sibling fusion altogether).
2. Avoid fusion when source has multiple outgoing edges.
3. Avoid fusion when source writes to an escaping/live-out memref.

Also, the worklist for traversing MDG will now have nodes in the
program-order. This helps to reach fixed-point in a fewer iterations for
strict producer-consumer loop nests.

Changes while porting to upstream:
1. In this and in a few previous commits as well, the FileCheck option
`dump-input-on-failure` causes unknown option error. So, disabling it
temporarily.


  Commit: 1309b1b25bd61e57a7121c6f8948bb7e794ca323
      https://github.com/llvm/llvm-project/commit/1309b1b25bd61e57a7121c6f8948bb7e794ca323
  Author: Vinayaka Bandishti <vinayaka at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Transforms/AffineCSPipeline.cpp
    M mlir/lib/Transforms/CMakeLists.txt
    A mlir/lib/Transforms/RemoveTrivialLoops.cpp
    A mlir/test/Transforms/remove-trivial-loop.mlir

  Log Message:
  -----------
  [MLIR] Implement remove-trivial-loops pass and add it to affine-cs-pipeline

Implement a pass to remove trivial affine loops (single iteration
affine.for) `-remove-trivial-loops` and add it to affine-cs-pipeline.

Changes while porting to upstream:
1. Move the auto-merged function declaration in Passes.h to appear
before include of `Passes.h.inc`.
2. `alloc` => `memref.alloc`.
3. Remove `--dump-input-on-failure` temporarily.


  Commit: f3210352bb4688807d76ecd345c67f11db9472a0
      https://github.com/llvm/llvm-project/commit/f3210352bb4688807d76ecd345c67f11db9472a0
  Author: Vinayaka Bandishti <vinayaka at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/lib/Transforms/LoopFusion.cpp
    M mlir/test/Transforms/affine-cs-pipeline.mlir

  Log Message:
  -----------
  [MLIR][Affine] Dealloc Op to not prevent single-store fusion

This commit addresses a limitation of the single-store fusion.
Many fusion opportunities are lost because a dealloc op is
considered a user of its argument memref, thereby making any
memref that is deallocated - an escaping memref. This is not
accurate. This is fixed by not marking a memref esacping, only
because it is an argument to a dealloc op.

Changes while porting to upstream:
1. `dealloc` -> `memref.dealloc`.


  Commit: 72a2ce508c08d6ee53a6073cdf684c360bf8d26f
      https://github.com/llvm/llvm-project/commit/72a2ce508c08d6ee53a6073cdf684c360bf8d26f
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/lib/Transforms/RemoveTrivialLoops.cpp

  Log Message:
  -----------
  [MLIR][NFC] Clean up remove trivial loops pass

Clean up remove trivial loops pass - use an existing utility. NFC.


  Commit: ff8908473293577e0a1c868d6db9c1fbadd90954
      https://github.com/llvm/llvm-project/commit/ff8908473293577e0a1c868d6db9c1fbadd90954
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Transforms/LoopFusion.cpp

  Log Message:
  -----------
  [MLIR] Affine fusion pass option to prevent fusion beyond specified terminal ops

Prevent affine fusion if the source node is terminated by an op
specified in the list of terminal fusion ops, i.e., the value being
stored to a candidate source memref is one of the specified op names.


  Commit: 61e0e92ab12f8080a8fa65edeb976d9b43ccf932
      https://github.com/llvm/llvm-project/commit/61e0e92ab12f8080a8fa65edeb976d9b43ccf932
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/lib/Transforms/AffineCSPipeline.cpp
    M mlir/test/Transforms/affine-cs-pipeline.mlir

  Log Message:
  -----------
  [MLIR][CS] Affine-cs-pipeline changes for terminal ops fusion option

Update affine-cs-pipeline to add fusion option to prevent fusion when
a source node has one of the listed ops as the root of its compute tree.

Changes while porting to upstream:
1. `sitofp` incompatibility in test case is fixed.
2. `alloc` => `memref.alloc`


  Commit: 815ef3e729c6eca654c4673d69a233aab22ce479
      https://github.com/llvm/llvm-project/commit/815ef3e729c6eca654c4673d69a233aab22ce479
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/lib/Transforms/AffineCSPipeline.cpp

  Log Message:
  -----------
  [MLIR] Change affine-cs-pipeline to run -affine-scalar-replacement before remove trivial loops

The affine fusion pass now has an option where certain fusion is
disabled when the terminal op of the producer is among a specific list
of ops specified. Running affine-scalar-replacement after
'remove-trivial-loops' would mean such fusion that would effectively
anyway happen via store to load forwarding. We actually don't need
affine-scalar-replacement after 'remove trivial loops' in
affine-cs-pipeline since the desired fusion would have anyway happened
as part of the fusion pass itself. It was earlier fine to run
-affine-scalar-replacement towards the end but with the
'terminal-fusion-ops' option, we should run it before.

Changes while porting to upstream:
1. Name change from `memref-dataflow-opt` to
`affine-scalar-replacement`.


  Commit: 597d072acbf54e64821068c9a24fd6a47269a995
      https://github.com/llvm/llvm-project/commit/597d072acbf54e64821068c9a24fd6a47269a995
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Transforms/AffineCSPipeline.cpp
    M mlir/lib/Transforms/LoopFusion.cpp
    M mlir/test/Transforms/affine-cs-pipeline.mlir

  Log Message:
  -----------
  Affine fusion option to prevent int64 to fp32 cast into consumers

Affine fusion option to prevent int64 to fp32 cast into consumers.
The `terminal-fusion-ops` option unfortunately can't provide such fine
grained control.


  Commit: cd0584cc0c1a0b0ab3472be01749cd5faa1c5b34
      https://github.com/llvm/llvm-project/commit/cd0584cc0c1a0b0ab3472be01749cd5faa1c5b34
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/test/Dialect/Affine/canonicalize.mlir

  Log Message:
  -----------
  [MLIR] Canonicalize single iteration constant loop bound IV operands to affine maps/sets

Canonicalize affine map/set operands that are single iteration constant
loop bound IVs (in canonicalizeMapAndOperands and
canonicalizeSetAndOperands). Also, fix getInductionVarOwner to guard
against cases where the block isn't fully linked into the IR (attached
to a region/op).


  Commit: 57b2addf5244e555254e18e781e803b49f365946
      https://github.com/llvm/llvm-project/commit/57b2addf5244e555254e18e781e803b49f365946
  Author: Prateek Gupta <prateek at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Analysis/Utils.h
    M mlir/include/mlir/Transforms/LoopFusionUtils.h
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Analysis/Utils.cpp
    M mlir/lib/Transforms/AffineCSPipeline.cpp
    M mlir/lib/Transforms/LoopFusion.cpp
    M mlir/lib/Transforms/Utils/LoopFusionUtils.cpp
    M mlir/test/Transforms/affine-cs-pipeline.mlir

  Log Message:
  -----------
  [AFFINE-FUSION] Add option to avoid FloorDiv, CeilDiv, Mod in access subscripts/loop bounds.

This commit adds an option avoid-divs-mods in the affine-loop-fusion
and affine-cs-pipeline to avoid operaitons like floordiv, ceildiv, mod in
the access subscripts/loop bounds. Relevant test cases are also added.

Signed-Off-By: Prateek Gupta <prateek.gupta at cerebras.net>

Changes while porting to upstream:
1. `alloc` => `memref.alloc`.


  Commit: 04f469eea83c43574d39fe6f685815c454ef11dc
      https://github.com/llvm/llvm-project/commit/04f469eea83c43574d39fe6f685815c454ef11dc
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h

  Log Message:
  -----------
  [MLIR] Fix createAffineCSPipelineExt declaration

A previous commit added an extra option to the definition of this create
method but missed updating its public declaration.


  Commit: f287e03616f558bfd29e68e4c5365a48f5326b2c
      https://github.com/llvm/llvm-project/commit/f287e03616f558bfd29e68e4c5365a48f5326b2c
  Author: Vinayaka Bandishti <vinayaka at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/test/Transforms/affine-cs-pipeline.mlir

  Log Message:
  -----------
  Use `-split-input-file` for cs pipeline test

Use `-split-input-file` option while testing `-affine-cs-pipeline`
without which enables modular and independent test cases.


  Commit: 96ef2a46defb8d40de81dd7c9515d77c5dd91913
      https://github.com/llvm/llvm-project/commit/96ef2a46defb8d40de81dd7c9515d77c5dd91913
  Author: Vinayaka Bandishti <vinayaka at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Transforms/AffineCSPipeline.cpp
    M mlir/lib/Transforms/LoopFusion.cpp
    M mlir/test/Transforms/affine-cs-pipeline.mlir

  Log Message:
  -----------
  Limit incoming memrefs during fusion

Add option `limit-input-memrefs` to affine fusion and
affine-cs-pipeline, to restrict the maximum number of incoming memrefs
into the resulting fused loop nest. By default, it is set to 4 for
affine-cs-pipeline and infinity for affine fusion to allow maximum
fusion.

Changes while porting to upstream:
1. `alloc` => `memref.alloc`.


  Commit: f1e4e916b8567a94f5ab5b4a88a13c1f63ed23cf
      https://github.com/llvm/llvm-project/commit/f1e4e916b8567a94f5ab5b4a88a13c1f63ed23cf
  Author: Vinayaka Bandishti <vinayaka at polymagelabs.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Transforms/Passes.h
    M mlir/lib/Transforms/AffineCSPipeline.cpp
    M mlir/lib/Transforms/LoopFusion.cpp

  Log Message:
  -----------
  [MLIR-Fusion] Consolidate fusion options

Add a placeholder for various options for fusion under
'LoopFusionOptions' so that it is easy to pass the options across
different classes involved in fusion.

Use the above mentioned LoopFusionOptions in affine-cs-pipeline pass.


  Commit: 6c70680518c390a6b5e7b8fcf5dfa2a5c79c14d1
      https://github.com/llvm/llvm-project/commit/6c70680518c390a6b5e7b8fcf5dfa2a5c79c14d1
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp

  Log Message:
  -----------
  Allow constant op to generate signless ints

Upstream MLIR has made a decision to disallow
unsigned/signed constant ops. While it is in line with MLIR design to
not allow signed/unsigned int types in the std and upstream dialects
(but to just encode signedness semantics on the op), we are allowing
this to temporarily to allow migration to upstream MLIR. We should roll
this back later and fix the passes HLO through Affine/Std to ensure that
unsigned types are converted out to signless types on ops of the right
kind.


  Commit: d359649ba016fd5354d268f06735b1133625b3b5
      https://github.com/llvm/llvm-project/commit/d359649ba016fd5354d268f06735b1133625b3b5
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp

  Log Message:
  -----------
  [MLIR] Temp fix for SIToFPOp to work with uint32

Signed-off-by: Uday Bondhugula <uday at cerebras.net>


  Commit: 2f45999026f5eaeac87e4052f0425b48e73ce46e
      https://github.com/llvm/llvm-project/commit/2f45999026f5eaeac87e4052f0425b48e73ce46e
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M mlir/lib/IR/BuiltinAttributes.cpp
    M mlir/test/Dialect/Standard/invalid.mlir

  Log Message:
  -----------
  [MLIR] Fix to integer attributes getInt() to work with uint32

Fix to integer attributes getInt() to work with uint32. This is a
temporary change. We should update the HLO -> affine lowerings to not
leave any ui32 types.

Signed-off-by: Uday Bondhugula <uday at cerebras.net>


  Commit: f17433cbc987a62c370d6686030c941c45fa8e87
      https://github.com/llvm/llvm-project/commit/f17433cbc987a62c370d6686030c941c45fa8e87
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-10-27 (Wed, 27 Oct 2021)

  Changed paths:
    A mlir/include/mlir/Dialect/mhlo/CMakeLists.txt
    A mlir/include/mlir/Dialect/mhlo/IR/CMakeLists.txt
    A mlir/include/mlir/Dialect/mhlo/IR/chlo_ops.h
    A mlir/include/mlir/Dialect/mhlo/IR/chlo_ops.td
    A mlir/include/mlir/Dialect/mhlo/IR/disc_ral_ops.h
    A mlir/include/mlir/Dialect/mhlo/IR/disc_ral_ops.td
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_ops.h
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_ops.td
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base.h
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base.td
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base_enums.h
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base_enums.td
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base_structs.h
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base_structs.td
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_common.h
    A mlir/include/mlir/Dialect/mhlo/IR/hlo_utils.td
    A mlir/include/mlir/Dialect/mhlo/IR/infer_shape_equality_op_interface.h
    A mlir/include/mlir/Dialect/mhlo/IR/infer_shape_equality_op_interface.td
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_dialect.td
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops.h
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops.td
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops_base.td
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops_enums.h
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops_enums.td
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops_structs.h
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops_structs.td
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops.h
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops.td
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops_base.td
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops_structs.h
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops_structs.td
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_structured_interface.h
    A mlir/include/mlir/Dialect/mhlo/IR/lhlo_structured_interface.td
    A mlir/include/mlir/Dialect/mhlo/IR/register.h
    A mlir/include/mlir/MhloUtils/broadcast_utils.h
    A mlir/include/mlir/MhloUtils/codegen_utils.h
    A mlir/include/mlir/MhloUtils/convert_op_folder.h
    A mlir/include/mlir/MhloUtils/cycle_detector.h
    A mlir/include/mlir/MhloUtils/disc_supported_list.h.inc
    A mlir/include/mlir/MhloUtils/hlo_utils.h
    A mlir/include/mlir/MhloUtils/lhlo_utils.h
    A mlir/include/mlir/MhloUtils/placement_utils.h
    A mlir/lib/Dialect/mhlo/CMakeLists.txt
    A mlir/lib/Dialect/mhlo/IR/CMakeLists.txt
    A mlir/lib/Dialect/mhlo/IR/chlo_canonicalize.td
    A mlir/lib/Dialect/mhlo/IR/chlo_ops.cc
    A mlir/lib/Dialect/mhlo/IR/disc_ral_ops.cc
    A mlir/lib/Dialect/mhlo/IR/hlo_ops.cc
    A mlir/lib/Dialect/mhlo/IR/hlo_ops_base_enums.cc
    A mlir/lib/Dialect/mhlo/IR/hlo_ops_base_structs.cc
    A mlir/lib/Dialect/mhlo/IR/hlo_ops_common.cc
    A mlir/lib/Dialect/mhlo/IR/hlo_patterns.td
    A mlir/lib/Dialect/mhlo/IR/infer_shape_equality_op_interface.cc
    A mlir/lib/Dialect/mhlo/IR/init.cc
    A mlir/lib/Dialect/mhlo/IR/lhlo_gpu_ops.cc
    A mlir/lib/Dialect/mhlo/IR/lhlo_gpu_ops_enums.cc
    A mlir/lib/Dialect/mhlo/IR/lhlo_gpu_ops_structs.cc
    A mlir/lib/Dialect/mhlo/IR/lhlo_ops.cc
    A mlir/lib/Dialect/mhlo/IR/lhlo_ops_structs.cc
    A mlir/lib/Dialect/mhlo/IR/lhlo_structured_interface.cc
    A mlir/lib/Dialect/mhlo/IR/mhlo_canonicalize.td
    A mlir/lib/MhloUtils/CMakeLists.txt
    A mlir/lib/MhloUtils/broadcast_utils.cc
    A mlir/lib/MhloUtils/codegen_utils.cc
    A mlir/lib/MhloUtils/convert_op_folder.cc
    A mlir/lib/MhloUtils/cycle_detector.cc
    A mlir/lib/MhloUtils/cycle_detector_test.cc
    A mlir/lib/MhloUtils/hlo_utils.cc
    A mlir/test/Dialect/mhlo/ops.mlir

  Log Message:
  -----------
  Import MLIR hlo dialects from mlir-hlo repository

Import MLIR hlo dialects from mlir-hlo repository
https://github.com/tensorflow/mlir-hlo.git at
b6f1d6b3755588d73d63a7becdda1b7e95b33d50

This imports just the MLIR HLO/LHLO dialects (ops libraries and its
dependencies "as is"). The dependencies also include MlirMhloUtils which
actually reside in a separate directory.

No changes to the imported files have been made in this commit.  For a
history of the changes, the mlir-hlo git repo could be referred to.

commit b6f1d6b3755588d73d63a7becdda1b7e95b33d50 (HEAD)
Author: A. Unique TensorFlower <gardener at tensorflow.org>
Date:   Mon Sep 20 03:26:12 2021 -0700

    Integrate LLVM at llvm/llvm-project at f5b8f1247cd9

    Updates LLVM usage to match
    [f5b8f1247cd9](https://github.com/llvm/llvm-project/commit/f5b8f1247cd9)

    PiperOrigin-RevId: 397710335


  Commit: 0d9833b9bdce1cb51ea72fd738e47c0b98b72d9b
      https://github.com/llvm/llvm-project/commit/0d9833b9bdce1cb51ea72fd738e47c0b98b72d9b
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-01 (Mon, 01 Nov 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/CMakeLists.txt
    M mlir/include/mlir/Dialect/mhlo/CMakeLists.txt
    M mlir/include/mlir/Dialect/mhlo/IR/chlo_ops.h
    M mlir/include/mlir/Dialect/mhlo/IR/chlo_ops.td
    M mlir/include/mlir/Dialect/mhlo/IR/disc_ral_ops.h
    M mlir/include/mlir/Dialect/mhlo/IR/hlo_ops.h
    M mlir/include/mlir/Dialect/mhlo/IR/hlo_ops.td
    M mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base.td
    M mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base_enums.h
    M mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base_structs.h
    M mlir/include/mlir/Dialect/mhlo/IR/infer_shape_equality_op_interface.h
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops.h
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops.td
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops_enums.h
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops_structs.h
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_gpu_ops_structs.td
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops.h
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops.td
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops_base.td
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops_structs.h
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops_structs.td
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_structured_interface.h
    M mlir/include/mlir/InitAllDialects.h
    M mlir/lib/CMakeLists.txt
    M mlir/lib/Dialect/CMakeLists.txt
    M mlir/lib/Dialect/mhlo/CMakeLists.txt
    M mlir/lib/Dialect/mhlo/IR/CMakeLists.txt
    M mlir/lib/Dialect/mhlo/IR/chlo_canonicalize.td
    M mlir/lib/Dialect/mhlo/IR/chlo_ops.cc
    M mlir/lib/Dialect/mhlo/IR/disc_ral_ops.cc
    M mlir/lib/Dialect/mhlo/IR/hlo_ops.cc
    M mlir/lib/Dialect/mhlo/IR/hlo_ops_base_enums.cc
    M mlir/lib/Dialect/mhlo/IR/hlo_ops_base_structs.cc
    M mlir/lib/Dialect/mhlo/IR/hlo_ops_common.cc
    M mlir/lib/Dialect/mhlo/IR/hlo_patterns.td
    M mlir/lib/Dialect/mhlo/IR/infer_shape_equality_op_interface.cc
    M mlir/lib/Dialect/mhlo/IR/init.cc
    M mlir/lib/Dialect/mhlo/IR/lhlo_gpu_ops.cc
    M mlir/lib/Dialect/mhlo/IR/lhlo_gpu_ops_enums.cc
    M mlir/lib/Dialect/mhlo/IR/lhlo_gpu_ops_structs.cc
    M mlir/lib/Dialect/mhlo/IR/lhlo_ops.cc
    M mlir/lib/Dialect/mhlo/IR/lhlo_ops_structs.cc
    M mlir/lib/Dialect/mhlo/IR/lhlo_structured_interface.cc
    M mlir/lib/Dialect/mhlo/IR/mhlo_canonicalize.td
    M mlir/lib/MhloUtils/broadcast_utils.cc
    M mlir/lib/MhloUtils/codegen_utils.cc
    M mlir/lib/MhloUtils/convert_op_folder.cc
    M mlir/lib/MhloUtils/cycle_detector.cc
    M mlir/lib/MhloUtils/cycle_detector_test.cc
    M mlir/lib/MhloUtils/hlo_utils.cc
    M mlir/test/Dialect/mhlo/ops.mlir
    M mlir/test/mlir-opt/commandline.mlir

  Log Message:
  -----------
  Changes to get MHLO dialect to build and pass tests

After a vanilla import of the relevant directories, this commit includes
changes to get mhlo dialects to build and pass check-mlir.

Rename library MhloDialect -> MLIRMhloDialect


  Commit: a6b9038347379a66e59d2a50a6cd3638fc6968c7
      https://github.com/llvm/llvm-project/commit/a6b9038347379a66e59d2a50a6cd3638fc6968c7
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-01 (Mon, 01 Nov 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/mhlo/IR/CMakeLists.txt
    R mlir/include/mlir/Dialect/mhlo/IR/chlo_ops.h
    R mlir/include/mlir/Dialect/mhlo/IR/chlo_ops.td
    M mlir/lib/Dialect/mhlo/IR/CMakeLists.txt
    R mlir/lib/Dialect/mhlo/IR/chlo_canonicalize.td
    R mlir/lib/Dialect/mhlo/IR/chlo_ops.cc
    M mlir/lib/Dialect/mhlo/IR/init.cc

  Log Message:
  -----------
  Remove chlo dialect from MLIR HLO dialects

We do not need the chlo dialect.


  Commit: fd2547bc18cb48a15c9b69033d3ff6942926c9e1
      https://github.com/llvm/llvm-project/commit/fd2547bc18cb48a15c9b69033d3ff6942926c9e1
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    A mlir/include/mlir/Dialect/mhlo/transforms/CMakeLists.txt
    A mlir/include/mlir/Dialect/mhlo/transforms/PassDetail.h
    A mlir/include/mlir/Dialect/mhlo/transforms/disc_ral_passes.td
    A mlir/include/mlir/Dialect/mhlo/transforms/fusion_utils.h
    A mlir/include/mlir/Dialect/mhlo/transforms/lhlo_elemental_utils.h
    A mlir/include/mlir/Dialect/mhlo/transforms/lmhlo_passes.td
    A mlir/include/mlir/Dialect/mhlo/transforms/map_chlo_to_hlo_op.h
    A mlir/include/mlir/Dialect/mhlo/transforms/map_hlo_to_lhlo_op.h
    A mlir/include/mlir/Dialect/mhlo/transforms/map_lmhlo_to_scalar_op.h
    A mlir/include/mlir/Dialect/mhlo/transforms/mhlo_passes.td
    A mlir/include/mlir/Dialect/mhlo/transforms/passes.h
    A mlir/include/mlir/Dialect/mhlo/transforms/register_passes.h
    A mlir/include/mlir/Dialect/mhlo/transforms/rewriters.h
    A mlir/include/mlir/Dialect/mhlo/transforms/type_conversion.h
    A mlir/lib/Dialect/mhlo/transforms/CMakeLists.txt
    A mlir/lib/Dialect/mhlo/transforms/broadcast_propagation.cc
    A mlir/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo.cc
    A mlir/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo_pass.cc
    A mlir/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo_patterns.td
    A mlir/lib/Dialect/mhlo/transforms/expand_hlo_tuples.cc
    A mlir/lib/Dialect/mhlo/transforms/fusion_utils.cc
    A mlir/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc
    A mlir/lib/Dialect/mhlo/transforms/hlo_legalize_to_memref.cc
    A mlir/lib/Dialect/mhlo/transforms/input_inline_fusion_pass.cc
    A mlir/lib/Dialect/mhlo/transforms/legalize_control_flow.cc
    A mlir/lib/Dialect/mhlo/transforms/legalize_einsum_to_dot_general.cc
    A mlir/lib/Dialect/mhlo/transforms/legalize_gather_to_torch_index_select.cc
    A mlir/lib/Dialect/mhlo/transforms/legalize_tensor_load_op.cc
    A mlir/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc
    A mlir/lib/Dialect/mhlo/transforms/legalize_to_standard.cc
    A mlir/lib/Dialect/mhlo/transforms/legalize_to_standard_patterns.td
    A mlir/lib/Dialect/mhlo/transforms/legalize_trigonometric_to_approximation.cc
    A mlir/lib/Dialect/mhlo/transforms/lhlo_elemental_utils.cc
    A mlir/lib/Dialect/mhlo/transforms/lhlo_fuse_linalg.cc
    A mlir/lib/Dialect/mhlo/transforms/lhlo_fusion.cc
    A mlir/lib/Dialect/mhlo/transforms/lhlo_fusion_inliner.cc
    A mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_roots_to_loops.cc
    A mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc
    A mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_to_gpu.cc
    A mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_to_parallel_loops.cc
    A mlir/lib/Dialect/mhlo/transforms/lower_complex.cc
    A mlir/lib/Dialect/mhlo/transforms/lower_complex_patterns.td
    A mlir/lib/Dialect/mhlo/transforms/lower_general_dot.cc
    A mlir/lib/Dialect/mhlo/transforms/materialize_broadcasts.cc
    A mlir/lib/Dialect/mhlo/transforms/materialize_broadcasts_pass.cc
    A mlir/lib/Dialect/mhlo/transforms/mhlo_canonicalize_reduction.cc
    A mlir/lib/Dialect/mhlo/transforms/mhlo_control_flow_to_scf.cc
    A mlir/lib/Dialect/mhlo/transforms/mhlo_flatten_tuple.cc
    A mlir/lib/Dialect/mhlo/transforms/mhlo_fusion.cc
    A mlir/lib/Dialect/mhlo/transforms/mhlo_mark_shape_calc.cc
    A mlir/lib/Dialect/mhlo/transforms/optimize_mhlo.cc
    A mlir/lib/Dialect/mhlo/transforms/optimize_mhlo_pass.cc
    A mlir/lib/Dialect/mhlo/transforms/ral_inject_execution_context.cc
    A mlir/lib/Dialect/mhlo/transforms/ral_legalize_to_llvm.cc
    A mlir/lib/Dialect/mhlo/transforms/ral_lower_to_library_call.cc
    A mlir/lib/Dialect/mhlo/transforms/rank_specialization.cc
    A mlir/lib/Dialect/mhlo/transforms/sink_constants_to_control_flow.cc
    A mlir/lib/Dialect/mhlo/transforms/test_infer_shaped_type_pass.cc
    A mlir/lib/Dialect/mhlo/transforms/type_conversion.cc
    A mlir/lib/Dialect/mhlo/transforms/unfuse_batch_norm.cc
    A mlir/lib/Dialect/mhlo/transforms/unfuse_batch_norm_pass.cc
    A mlir/test/Dialect/mhlo/hlo-legalize-to-lhlo-only-dynamic.mlir
    A mlir/test/Dialect/mhlo/hlo-legalize-to-lhlo-unranked.mlir
    A mlir/test/Dialect/mhlo/hlo-legalize-to-lhlo.mlir
    A mlir/test/Dialect/mhlo/hlo-legalize-to-linalg.mlir
    A mlir/test/Dialect/mhlo/hlo-legalize-to-memref-unranked.mlir
    A mlir/test/Dialect/mhlo/hlo-legalize-to-memref.mlir
    A mlir/test/Dialect/mhlo/hlo_ops.mlir
    A mlir/test/Dialect/mhlo/lhlo-legalize-to-affine.mlir
    A mlir/test/Dialect/mhlo/lhlo-legalize-to-gpu.mlir
    A mlir/test/Dialect/mhlo/lhlo-legalize-to-linalg.mlir
    A mlir/test/Dialect/mhlo/lhlo-legalize-to-parallel-loops.mlir
    A mlir/test/Dialect/mhlo/lhlo_ops.mlir
    R mlir/test/Dialect/mhlo/ops.mlir

  Log Message:
  -----------
  Import mhlo transforms (mhlo and lhlo passes) as is

Import mhlo transforms (mhlo and lhlo passes) as is from upstream
mlir-hlo. No changes to these in this commit.

Add mhlo /lmhlo passes test cases. Add missed lhlo ops test case.


  Commit: 2cbe9d67e6d6254c63c8f8f202e88d48df8ac26c
      https://github.com/llvm/llvm-project/commit/2cbe9d67e6d6254c63c8f8f202e88d48df8ac26c
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/CMakeLists.txt
    R mlir/include/mlir/Dialect/LHLO/CMakeLists.txt
    R mlir/include/mlir/Dialect/LHLO/IR/CMakeLists.txt
    R mlir/include/mlir/Dialect/LHLO/IR/HLOOpsBase.td
    R mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.h
    R mlir/include/mlir/Dialect/LHLO/IR/LHLOOps.td
    M mlir/include/mlir/Dialect/mhlo/CMakeLists.txt
    M mlir/include/mlir/Dialect/mhlo/transforms/PassDetail.h
    M mlir/include/mlir/Dialect/mhlo/transforms/fusion_utils.h
    M mlir/include/mlir/Dialect/mhlo/transforms/map_chlo_to_hlo_op.h
    M mlir/include/mlir/Dialect/mhlo/transforms/map_hlo_to_lhlo_op.h
    M mlir/include/mlir/Dialect/mhlo/transforms/map_lmhlo_to_scalar_op.h
    M mlir/include/mlir/Dialect/mhlo/transforms/mhlo_passes.td
    M mlir/include/mlir/Dialect/mhlo/transforms/passes.h
    M mlir/include/mlir/Dialect/mhlo/transforms/register_passes.h
    M mlir/include/mlir/InitAllDialects.h
    M mlir/include/mlir/InitAllPasses.h
    M mlir/lib/Dialect/CMakeLists.txt
    R mlir/lib/Dialect/LHLO/CMakeLists.txt
    R mlir/lib/Dialect/LHLO/IR/CMakeLists.txt
    R mlir/lib/Dialect/LHLO/IR/LHLOOps.cc
    M mlir/lib/Dialect/mhlo/CMakeLists.txt
    M mlir/lib/Dialect/mhlo/transforms/CMakeLists.txt
    R mlir/lib/Dialect/mhlo/transforms/broadcast_propagation.cc
    M mlir/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo.cc
    M mlir/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo_pass.cc
    M mlir/lib/Dialect/mhlo/transforms/chlo_legalize_to_hlo_patterns.td
    M mlir/lib/Dialect/mhlo/transforms/expand_hlo_tuples.cc
    M mlir/lib/Dialect/mhlo/transforms/fusion_utils.cc
    M mlir/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc
    M mlir/lib/Dialect/mhlo/transforms/hlo_legalize_to_memref.cc
    M mlir/lib/Dialect/mhlo/transforms/input_inline_fusion_pass.cc
    M mlir/lib/Dialect/mhlo/transforms/legalize_control_flow.cc
    M mlir/lib/Dialect/mhlo/transforms/legalize_einsum_to_dot_general.cc
    M mlir/lib/Dialect/mhlo/transforms/legalize_gather_to_torch_index_select.cc
    M mlir/lib/Dialect/mhlo/transforms/legalize_tensor_load_op.cc
    M mlir/lib/Dialect/mhlo/transforms/legalize_to_linalg.cc
    M mlir/lib/Dialect/mhlo/transforms/legalize_to_standard.cc
    M mlir/lib/Dialect/mhlo/transforms/legalize_to_standard_patterns.td
    M mlir/lib/Dialect/mhlo/transforms/legalize_trigonometric_to_approximation.cc
    M mlir/lib/Dialect/mhlo/transforms/lhlo_elemental_utils.cc
    M mlir/lib/Dialect/mhlo/transforms/lhlo_fuse_linalg.cc
    M mlir/lib/Dialect/mhlo/transforms/lhlo_fusion.cc
    M mlir/lib/Dialect/mhlo/transforms/lhlo_fusion_inliner.cc
    M mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_roots_to_loops.cc
    M mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc
    M mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_to_gpu.cc
    M mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_to_parallel_loops.cc
    M mlir/lib/Dialect/mhlo/transforms/lower_complex.cc
    M mlir/lib/Dialect/mhlo/transforms/lower_complex_patterns.td
    M mlir/lib/Dialect/mhlo/transforms/lower_general_dot.cc
    M mlir/lib/Dialect/mhlo/transforms/materialize_broadcasts.cc
    M mlir/lib/Dialect/mhlo/transforms/materialize_broadcasts_pass.cc
    M mlir/lib/Dialect/mhlo/transforms/mhlo_canonicalize_reduction.cc
    M mlir/lib/Dialect/mhlo/transforms/mhlo_control_flow_to_scf.cc
    M mlir/lib/Dialect/mhlo/transforms/mhlo_flatten_tuple.cc
    M mlir/lib/Dialect/mhlo/transforms/mhlo_fusion.cc
    M mlir/lib/Dialect/mhlo/transforms/mhlo_mark_shape_calc.cc
    M mlir/lib/Dialect/mhlo/transforms/optimize_mhlo.cc
    M mlir/lib/Dialect/mhlo/transforms/optimize_mhlo_pass.cc
    M mlir/lib/Dialect/mhlo/transforms/ral_inject_execution_context.cc
    M mlir/lib/Dialect/mhlo/transforms/ral_legalize_to_llvm.cc
    M mlir/lib/Dialect/mhlo/transforms/ral_lower_to_library_call.cc
    R mlir/lib/Dialect/mhlo/transforms/rank_specialization.cc
    M mlir/lib/Dialect/mhlo/transforms/sink_constants_to_control_flow.cc
    M mlir/lib/Dialect/mhlo/transforms/test_infer_shaped_type_pass.cc
    M mlir/lib/Dialect/mhlo/transforms/type_conversion.cc
    M mlir/lib/Dialect/mhlo/transforms/unfuse_batch_norm.cc
    M mlir/lib/Dialect/mhlo/transforms/unfuse_batch_norm_pass.cc
    R mlir/test/Dialect/LHLO/invalid.mlir
    R mlir/test/Dialect/LHLO/lhlo_ops.mlir
    M mlir/tools/mlir-opt/CMakeLists.txt
    M mlir/tools/mlir-reduce/CMakeLists.txt

  Log Message:
  -----------
  Changes to get Mhlo and Lhlo passes to build

Directory rename: mlir-hlo -> mlir, mlir-hlo/utils -> mlir/MhloUtils for
includes.

MhloPasses was missing the link targets MhloPassIncGen, LmhloPassIncGen,
DiscRalIncGen.

Remove broadcast_propagation and rank_specialization since they depend
on chlo and we don't need them.

Switch lmhlo dialect to the newly imported one. Remove old LHLO dialect
which is now a duplicate since we brought it in from upstream.


  Commit: a8340bf70ee6908c783394eef760c6443ad43199
      https://github.com/llvm/llvm-project/commit/a8340bf70ee6908c783394eef760c6443ad43199
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base.td
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops.td
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops_base.td
    M mlir/lib/Dialect/mhlo/IR/lhlo_ops.cc

  Log Message:
  -----------
  Add lmhlo tuple ops for backward compatibility

Add lmhlo tuple ops for backward compatibility. These were removed
upstream. We'll add them back and keep them till we migrate away
completely.


  Commit: bb56fa26d2d8c3b611e75431532c9a0d287dbccb
      https://github.com/llvm/llvm-project/commit/bb56fa26d2d8c3b611e75431532c9a0d287dbccb
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops.td
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops_base.td

  Log Message:
  -----------
  Add LMHLO yield and if ops for backward compatibility

Add lmhlo yield and if ops. The lmhlo if op didn't exist.


  Commit: 76cafafc17a30790f3212b29a6e17d33cfd6696c
      https://github.com/llvm/llvm-project/commit/76cafafc17a30790f3212b29a6e17d33cfd6696c
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    R mlir/test/Analysis/test-uninitialized-memrefs.mlir
    M mlir/test/lib/Dialect/Affine/CMakeLists.txt
    R mlir/test/lib/Dialect/Affine/TestUninitializedMemRefCheck.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  Revert "[MLIR] Introduce pass to detect uninitialized memref reads"

This reverts commit ad24d8de32526421a9724e1b3efa449bc1e14ba3.

Remove this pass - add it back after porting to the current LMHLO
dialect.


  Commit: 5b08c52ea0be64a2414a1cb23ec00d068353bbab
      https://github.com/llvm/llvm-project/commit/5b08c52ea0be64a2414a1cb23ec00d068353bbab
  Author: Uday Bondhugula <uday at cerebras.net>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M mlir/lib/Dialect/mhlo/transforms/CMakeLists.txt
    M mlir/tools/mlir-reduce/CMakeLists.txt

  Log Message:
  -----------
  Switch add_mlir_library -> add_mlir_dialect_library for MHLO/Lmhlo passes

Without the latter, the libraries won't get added to `dialect_libs` and
this would lead to link-time issues on those passes for the various
tools using MLIROptLib for example.


  Commit: b60b2e1d4819522c6361c88337cf5700f42a91f3
      https://github.com/llvm/llvm-project/commit/b60b2e1d4819522c6361c88337cf5700f42a91f3
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-03 (Wed, 03 Nov 2021)

  Changed paths:
    M mlir/lib/Dialect/mhlo/transforms/mhlo_flatten_tuple.cc

  Log Message:
  -----------
  Drop static pass registration from mhlo_flatten_tuple.cc


  Commit: 1d4f94ebd088c969beef7221a37495b8e7cd8d22
      https://github.com/llvm/llvm-project/commit/1d4f94ebd088c969beef7221a37495b8e7cd8d22
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-03 (Wed, 03 Nov 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/mhlo/IR/hlo_ops_base.td
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops.td

  Log Message:
  -----------
  Add lmhlo rng_normal and uniform ops


  Commit: 82aadfb63f55add5cfc130557f327ac642c7716d
      https://github.com/llvm/llvm-project/commit/82aadfb63f55add5cfc130557f327ac642c7716d
  Author: Abhishek Varma <abhishek.varma at polymagelabs.com>
  Date:   2021-11-03 (Wed, 03 Nov 2021)

  Changed paths:
    M mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc
    M mlir/test/Dialect/mhlo/lhlo-legalize-to-affine.mlir

  Log Message:
  -----------
  [MLIR] Conversion for ReduceOp LHLO -> Affine

-- This commit adds LHLO -> Affine conversion of ReduceOp.

Authored-by: Uday Bondhugula

Committed-by: Abhishek Varma


  Commit: f2e5b6a3a4a602289b9057d048d1fe0dea79f926
      https://github.com/llvm/llvm-project/commit/f2e5b6a3a4a602289b9057d048d1fe0dea79f926
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-03 (Wed, 03 Nov 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/mhlo/IR/lhlo_ops.td
    M mlir/test/Dialect/mhlo/lhlo_ops.mlir

  Log Message:
  -----------
  [MLIR] Allow lhlo while op to have results + other updates

This brings in a local change we had. We do need the `while` op to have
results to convert from hlo -> lhlo while. In addition, align its
arguments and traits to what we needed for HLO -> LHLO lowering.

We need to revisit this to see whether to align with upstream design.


  Commit: 0a2c0b200f375fece0ecd0daf67cba306407f665
      https://github.com/llvm/llvm-project/commit/0a2c0b200f375fece0ecd0daf67cba306407f665
  Author: Vinayaka Bandishti <vinayaka at polymagelabs.com>
  Date:   2021-11-03 (Wed, 03 Nov 2021)

  Changed paths:
    M mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc
    M mlir/test/Dialect/mhlo/lhlo-legalize-to-affine.mlir

  Log Message:
  -----------
  [LMHLO-Affine] Add Slice op converter

Lower `lmhlo::SliceOp` to affine dialect using a loop nest of affine for
ops, affine loads and affine stores.


  Commit: 91505cddc4a0e7c50c971cbf6f92ad81e2d8c431
      https://github.com/llvm/llvm-project/commit/91505cddc4a0e7c50c971cbf6f92ad81e2d8c431
  Author: Arnab Dutta <arnab.dutta at cerebras.net>
  Date:   2021-11-03 (Wed, 03 Nov 2021)

  Changed paths:
    M mlir/lib/Dialect/mhlo/transforms/lhlo_legalize_to_affine.cc
    M mlir/test/Dialect/mhlo/lhlo-legalize-to-affine.mlir

  Log Message:
  -----------
  [MLIR] Add ScatterOp from lhlo to affine

ScatterOp is added, this is a part of lhlo-legalize-to-affine pass.

Ported/adapted by Arnab Dutta <arnab at polymagelabs.com>.

Signed-off-by: Prashant Kumar <prashantk at polymagelabs.com>


  Commit: 324d6767518094753ff61a17ce753733b5078015
      https://github.com/llvm/llvm-project/commit/324d6767518094753ff61a17ce753733b5078015
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-05 (Fri, 05 Nov 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
    M mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
    M mlir/test/Dialect/MemRef/canonicalize.mlir

  Log Message:
  -----------
  [MLIR] Eliminate in-placable memref.copy ops in certain cases

Eliminate in-placeable memref.copy ops in certain cases. The memref.copy
is eliminated and substituted by the target operand of the copy in
scenarios where the latter is a block argument that dominates the
allocating defining op of the source.


  Commit: 43d39ceadc277ed432f6c67e1d16101deac33472
      https://github.com/llvm/llvm-project/commit/43d39ceadc277ed432f6c67e1d16101deac33472
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-05 (Fri, 05 Nov 2021)

  Changed paths:
    M mlir/lib/Transforms/Bufferize.cpp

  Log Message:
  -----------
  [MLIR] Bufferization type conversion update for non tensor types

Update bufferization type converter to be resilient to non-tensor types.
Instead of asserting, simply return the same value. This is a temporary
fix before a proper/general solution is used. In the current scenario,
the converter gets called on elemental types too and obviously tensor ->
memref conversion isn't applicable there.


  Commit: c627f13f221a5dfe916a87c61cb0555e6ff13473
      https://github.com/llvm/llvm-project/commit/c627f13f221a5dfe916a87c61cb0555e6ff13473
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-05 (Fri, 05 Nov 2021)

  Changed paths:
    M mlir/include/mlir/Dialect/mhlo/transforms/PassDetail.h
    M mlir/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc

  Log Message:
  -----------
  [MLIR] Add hlo scalar pointwise to std converter

Add converter for HLO pointwise ops on scalar/0-d types to std/math
dialect ops. Add this for a number of op types.


  Commit: e5528b53e6f86e16c8d66d2ce15631a444fedd0d
      https://github.com/llvm/llvm-project/commit/e5528b53e6f86e16c8d66d2ce15631a444fedd0d
  Author: Uday Bondhugula <uday at polymagelabs.com>
  Date:   2021-11-05 (Fri, 05 Nov 2021)

  Changed paths:
    M mlir/lib/Dialect/mhlo/transforms/hlo_legalize_to_lhlo.cc
    M mlir/test/Dialect/mhlo/hlo-legalize-to-lhlo.mlir
    M mlir/test/Dialect/mhlo/lhlo-legalize-to-affine.mlir

  Log Message:
  -----------
  [MLIR] Add mhlo -> lmhlo conversion for ScatterOp

Add mhlo -> lmhlo conversion for ScatterOp.

Add conversion for mhlo.return ops in reduce/scatter regions


Compare: https://github.com/llvm/llvm-project/compare/1e17c40c4ce8%5E...e5528b53e6f8


More information about the All-commits mailing list