[all-commits] [llvm/llvm-project] 15a655: [mlir][ods] ODS-level Attribute Optimizations

Jeff Niu via All-commits all-commits at lists.llvm.org
Mon Apr 11 11:34:19 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 15a65594c1c0321671a827582fd66a22e0dbdc6e
  Author: Mogball <jeffniu22 at gmail.com>
  Date:   2022-04-11 (Mon, 11 Apr 2022)

  Changed paths:
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/test/Dialect/LLVMIR/global.mlir
    M mlir/test/IR/attribute.mlir
    M mlir/test/mlir-tblgen/constraint-unique.td
    M mlir/test/mlir-tblgen/op-attribute.td
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

  Log Message:
  [mlir][ods] ODS-level Attribute Optimizations

This patch contains several ODS-level optimizations to attribute getters and getting.

1. OpAdaptors, when provided a DictionaryAttr, will instantiate an OperationName so that adaptor attribute getters can used cached identifiers.
2. Verifiers will take advantage of attributes stored in sorted order to get all required (non-optional, non-default valued, and non-derived) attributes in one pass over the attribute dictionary and verify that they are present.
3. ODS-generated attribute getters will use "subrange" lookup. Because the attributes are stored in sorted order and ODS knows which attributes are required, the number of required attributes less than and greater than each attribute can be computed. When searching for an attribute, the ends of the search range can be dropped.

Reviewed By: jpienaar

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

More information about the All-commits mailing list