[all-commits] [llvm/llvm-project] 628288: [MLIR] Add RegionKindInterface

stephenneuendorffer via All-commits all-commits at lists.llvm.org
Wed Jul 15 14:32:30 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 628288658c5ba14923e1be566b64bada650e35bc
      https://github.com/llvm/llvm-project/commit/628288658c5ba14923e1be566b64bada650e35bc
  Author: Stephen Neuendorffer <stephen.neuendorffer at xilinx.com>
  Date:   2020-07-15 (Wed, 15 Jul 2020)

  Changed paths:
    M mlir/docs/Interfaces.md
    M mlir/docs/LangRef.md
    M mlir/include/mlir/IR/CMakeLists.txt
    M mlir/include/mlir/IR/Dominance.h
    A mlir/include/mlir/IR/RegionKindInterface.h
    A mlir/include/mlir/IR/RegionKindInterface.td
    M mlir/lib/IR/CMakeLists.txt
    M mlir/lib/IR/Dominance.cpp
    A mlir/lib/IR/RegionKindInterface.cpp
    M mlir/lib/IR/Verifier.cpp
    M mlir/lib/Transforms/CSE.cpp
    M mlir/test/CMakeLists.txt
    M mlir/test/IR/invalid.mlir
    M mlir/test/IR/parser.mlir
    M mlir/test/IR/traits.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestDialect.h
    M mlir/test/lib/Dialect/Test/TestOps.td

  Log Message:
  -----------
  [MLIR] Add RegionKindInterface

Some dialects have semantics which is not well represented by common
SSA structures with dominance constraints.  This patch allows
operations to declare the 'kind' of their contained regions.
Currently, two kinds are allowed: "SSACFG" and "Graph".  The only
difference between them at the moment is that SSACFG regions are
required to have dominance, while Graph regions are not required to
have dominance.  The intention is that this Interface would be
generated by ODS for existing operations, although this has not yet
been implemented. Presumably, if someone were interested in code
generation, we might also have a "CFG" dialect, which defines control
flow, but does not require SSA.

The new behavior is mostly identical to the previous behavior, since
registered operations without a RegionKindInterface are assumed to
contain SSACFG regions.  However, the behavior has changed for
unregistered operations.  Previously, these were checked for
dominance, however the new behavior allows dominance violations, in
order to allow the processing of unregistered dialects with Graph
regions.  One implication of this is that regions in unregistered
operations with more than one op are no longer CSE'd (since it
requires dominance info).

I've also reorganized the LangRef documentation to remove assertions
about "sequential execution", "SSA Values", and "Dominance".  Instead,
the core IR is simply "ordered" (i.e. totally ordered) and consists of
"Values".  I've also clarified some things about how control flow
passes between blocks in an SSACFG region. Control Flow must enter a
region at the entry block and follow terminator operation successors
or be returned to the containing op.  Graph regions do not define a
notion of control flow.

see discussion here:
https://llvm.discourse.group/t/rfc-allowing-dialects-to-relax-the-ssa-dominance-condition/833/53

Differential Revision: https://reviews.llvm.org/D80358




More information about the All-commits mailing list