[all-commits] [llvm/llvm-project] fd01d8: [mlir] Rewrite the internal representation of OpRe...

River Riddle via All-commits all-commits at lists.llvm.org
Thu Jan 2 14:40:33 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: fd01d8626cdcce9f34caab060f8d3fd35f6661cc
      https://github.com/llvm/llvm-project/commit/fd01d8626cdcce9f34caab060f8d3fd35f6661cc
  Author: River Riddle <riverriddle at google.com>
  Date:   2020-01-02 (Thu, 02 Jan 2020)

  Changed paths:
    M mlir/include/mlir/IR/Operation.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/IR/Value.h
    M mlir/include/mlir/Support/STLExtras.h
    M mlir/lib/IR/Operation.cpp
    M mlir/lib/IR/OperationSupport.cpp
    M mlir/lib/IR/Value.cpp
    M mlir/test/lib/Transforms/TestInlining.cpp

  Log Message:
  -----------
  [mlir] Rewrite the internal representation of OpResult to be optimized for memory.

Summary:
This changes the implementation of OpResult to have some of the results be represented inline in Value, via a pointer int pair of Operation*+result number, and the rest being trailing objects on the main operation. The full details of the new representation is detailed in the proposal here:
https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ

The only difference between here and the above proposal is that we only steal 2-bits for the Value kind instead of 3. This means that we can only fit 2-results inline instead of 6. This allows for other users to steal the final bit for PointerUnion/etc. If necessary, we can always steal this bit back in the future to save more space if 3-6 results are common enough.

Reviewed By: jpienaar

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




More information about the All-commits mailing list