[all-commits] [llvm/llvm-project] 5eae71: [mlir] Add NamedAttrList

Jacques Pienaar via All-commits all-commits at lists.llvm.org
Thu May 7 12:38:49 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5eae715a3115be2640d0fd37d0bd4771abf2ab9b
      https://github.com/llvm/llvm-project/commit/5eae715a3115be2640d0fd37d0bd4771abf2ab9b
  Author: Jacques Pienaar <jpienaar at google.com>
  Date:   2020-05-07 (Thu, 07 May 2020)

  Changed paths:
    M flang/include/flang/Optimizer/Dialect/FIROps.td
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M mlir/include/mlir/IR/Attributes.h
    M mlir/include/mlir/IR/FunctionImplementation.h
    M mlir/include/mlir/IR/FunctionSupport.h
    M mlir/include/mlir/IR/OpImplementation.h
    M mlir/include/mlir/IR/Operation.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/Interfaces/InferTypeOpInterface.h
    M mlir/include/mlir/Interfaces/InferTypeOpInterface.td
    M mlir/lib/Analysis/CallGraph.cpp
    M mlir/lib/Dialect/Affine/IR/AffineOps.cpp
    M mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVCanonicalization.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
    M mlir/lib/Dialect/Shape/IR/Shape.cpp
    M mlir/lib/Dialect/Vector/VectorOps.cpp
    M mlir/lib/IR/Attributes.cpp
    M mlir/lib/IR/Function.cpp
    M mlir/lib/IR/FunctionImplementation.cpp
    M mlir/lib/IR/MLIRContext.cpp
    M mlir/lib/IR/Operation.cpp
    M mlir/lib/IR/OperationSupport.cpp
    M mlir/lib/IR/SymbolTable.cpp
    M mlir/lib/Interfaces/InferTypeOpInterface.cpp
    M mlir/lib/Parser/Parser.cpp
    M mlir/lib/Pass/IRPrinting.cpp
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
    M mlir/tools/mlir-tblgen/OpFormatGen.cpp

  Log Message:
  -----------
  [mlir] Add NamedAttrList

This is a wrapper around vector of NamedAttributes that keeps track of whether sorted and does some minimal effort to remain sorted (doing more, e.g., appending attributes in sorted order, could be done in follow up). It contains whether sorted and if a DictionaryAttr is queried, it caches the returned DictionaryAttr along with whether sorted.

Change MutableDictionaryAttr to always return a non-null Attribute even when empty (reserve null cases for errors). To this end change the getter to take a context as input so that the empty DictionaryAttr could be queried. Also create one instance of the empty dictionary attribute that could be reused without needing to lock context etc.

Update infer type op interface to use DictionaryAttr and use NamedAttrList to avoid incurring multiple conversion costs.

Fix bug in sorting helper function.

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




More information about the All-commits mailing list