[all-commits] [llvm/llvm-project] d989ae: [mlir][SIdeEffectInterface][NFC] Move several Inte...

River Riddle via All-commits all-commits at lists.llvm.org
Tue Oct 27 16:21:36 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d989ae90693ec2d1b7e048a7b48cbab3cfa8123b
      https://github.com/llvm/llvm-project/commit/d989ae90693ec2d1b7e048a7b48cbab3cfa8123b
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-10-27 (Tue, 27 Oct 2020)

  Changed paths:
    M mlir/include/mlir/Interfaces/SideEffectInterfaces.td

  Log Message:
  -----------
  [mlir][SIdeEffectInterface][NFC] Move several InterfaceMethods to the extraClassDeclarations instead

All InterfaceMethods will have a corresponding entry in the interface model, and by extension have an implementation generated for every operation type. This can result in large binary size increases when a large amount of operations use an interface, such as the side effect interface.

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


  Commit: ef728eaf6e8de17b9f5bac89c972a94e37e4f09e
      https://github.com/llvm/llvm-project/commit/ef728eaf6e8de17b9f5bac89c972a94e37e4f09e
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-10-27 (Tue, 27 Oct 2020)

  Changed paths:
    M mlir/tools/mlir-tblgen/OpInterfacesGen.cpp

  Log Message:
  -----------
  [mlir][Interfaces] Generate a struct containing function pointers instead of a class with vtables

When compiling for code size, the use of a vtable causes a destructor(and constructor in certain cases) to be generated for the class. Interface models don't need a complex constructor or a destructor, so this can lead to many megabytes of code size increase(even in opt). This revision switches to a simpler struct of function pointers approach that accomplishes the same API requirements as before. This change requires no updates to user code, or any other code aside from the generator, as the user facing API is still exactly the same.

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


  Commit: eacac2679ddb2b53025a11933eb222eaf75812ef
      https://github.com/llvm/llvm-project/commit/eacac2679ddb2b53025a11933eb222eaf75812ef
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-10-27 (Tue, 27 Oct 2020)

  Changed paths:
    M mlir/include/mlir/Support/InterfaceSupport.h

  Log Message:
  -----------
  [mlir][Interfaces] Optimize the implementation of InterfaceMap to reduce generated code size.

An InterfaceMap is generated for every single operation type, and is responsible for a large amount of the code size from MLIR given that its internals highly utilize templates. This revision refactors the internal implementation to use bare malloc/free for interface instances as opposed to static variables and moves as much code out of templates as possible. This led to a decrease of over >1mb (~12% of total MLIR related code size) for a downstream MLIR library with a large amount of operations.

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


  Commit: 935d708568d755a091dfa13af04246858938d7fa
      https://github.com/llvm/llvm-project/commit/935d708568d755a091dfa13af04246858938d7fa
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-10-27 (Tue, 27 Oct 2020)

  Changed paths:
    M mlir/include/mlir/IR/PatternMatch.h

  Log Message:
  -----------
  [mlir][NFC] Remove unnecessary PatternRewriter::create methods

At this point, these methods are just carbon copies of OpBuilder::create and aren't necessary given that PatternRewriter inherits from OpBuilder.

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


Compare: https://github.com/llvm/llvm-project/compare/9d5239d39e48...935d708568d7


More information about the All-commits mailing list