[PATCH] D75314: [mlir] Add a new BranchOpInterface to allow for opaquely interfacing with branching terminator operations.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 16:47:21 PST 2020


rriddle created this revision.
rriddle added reviewers: mehdi_amini, jpienaar.
Herald added subscribers: llvm-commits, bader, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, nicolasvasilache, antiagainst, shauheen, burmako.
Herald added a reviewer: mravishankar.
Herald added a reviewer: antiagainst.
Herald added a project: LLVM.
rriddle added a child revision: D75315: [mlir][DeclarativeParser] Add support for formatting operations with AttrSizedOperandSegments..

This interface contains the necessary components to provide the same builtin behavior that terminators have. This will be used in future revisions to remove many of the hardcoded constraints placed on successors and successor operands. The interface initially contains three methods:

  c++
  // Return a set of values corresponding to the operands for successor 'index', or None if the operands do not correspond to materialized values.
  Optional<OperandRange> getSuccessorOperands(unsigned index);
  
  // Return true if this terminator can have it's successor operands erased.
  bool canEraseSuccessorOperand();
  
  // Erase the operand of a successor. This is only valid to call if 'canEraseSuccessorOperand' returns true.
  void eraseSuccessorOperand(unsigned succIdx, unsigned opIdx);

Depends On D75313 <https://reviews.llvm.org/D75313>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75314

Files:
  mlir/include/mlir/Analysis/ControlFlowInterfaces.h
  mlir/include/mlir/Analysis/ControlFlowInterfaces.td
  mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
  mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
  mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
  mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h
  mlir/include/mlir/Dialect/StandardOps/IR/Ops.h
  mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
  mlir/include/mlir/IR/OperationSupport.h
  mlir/lib/Analysis/ControlFlowInterfaces.cpp
  mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
  mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
  mlir/lib/Dialect/StandardOps/IR/Ops.cpp
  mlir/lib/IR/Operation.cpp
  mlir/lib/IR/OperationSupport.cpp
  mlir/test/lib/TestDialect/TestDialect.cpp
  mlir/test/lib/TestDialect/TestDialect.h
  mlir/test/lib/TestDialect/TestOps.td
  mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75314.247131.patch
Type: text/x-patch
Size: 25857 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200228/0e49239b/attachment-0001.bin>


More information about the llvm-commits mailing list