[all-commits] [llvm/llvm-project] 51e370: [MLIR] Don't insert YieldOp for non-void loop.for ...

Alexander Belyaev via All-commits all-commits at lists.llvm.org
Sun Apr 5 02:55:07 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 51e3709c2b9055fe9e6fc83fc7f056bd55b2aaa6
      https://github.com/llvm/llvm-project/commit/51e3709c2b9055fe9e6fc83fc7f056bd55b2aaa6
  Author: Alexander Belyaev <pifon at google.com>
  Date:   2020-04-05 (Sun, 05 Apr 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/LoopOps/LoopOps.td
    M mlir/lib/Conversion/LoopToStandard/LoopToStandard.cpp
    M mlir/lib/Dialect/LoopOps/LoopOps.cpp

  Log Message:
  -----------
  [MLIR] Don't insert YieldOp for non-void loop.for by default.

The ForOp::build ensures that there is a block terminator which is great for
the default use case when there are no iter_args and loop.for returns no
results.  In non-zero results case we always need to call replaceOpWithNewOp
which is not the nicest thing in the world. We can stop inserting YieldOp when
iter_args is non-empty. IfOp::build already behaves similarly.




More information about the All-commits mailing list