[all-commits] [llvm/llvm-project] aaa298: [MLIR Core] Cache the empty StringAttr like we do ...

Chris Lattner via All-commits all-commits at lists.llvm.org
Tue May 25 14:58:36 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aaa2982d7191eaf8638c91d0aa5b16f5523a1fc8
      https://github.com/llvm/llvm-project/commit/aaa2982d7191eaf8638c91d0aa5b16f5523a1fc8
  Author: Chris Lattner <clattner at nondot.org>
  Date:   2021-05-25 (Tue, 25 May 2021)

  Changed paths:
    M mlir/include/mlir/IR/BuiltinAttributes.td
    M mlir/lib/IR/BuiltinAttributes.cpp
    M mlir/lib/IR/MLIRContext.cpp

  Log Message:
  -----------
  [MLIR Core] Cache the empty StringAttr like we do for empty dictionaries. NFC.

MLIRContext holds a few special case values that occur frequently like empty
dictionary and NoneType, which allow us to avoid taking locks to get an instance
of them.  Give the empty StringAttr this treatment as well.  This cuts several
percent off compile time for CIRCT.

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




More information about the All-commits mailing list