[all-commits] [llvm/llvm-project] 9170fa: [mlir][LLVM] Convert access group metadata to usin...

Markus Böck via All-commits all-commits at lists.llvm.org
Fri Jul 14 05:59:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9170fa58082e368f8b6ed8e0e6ef88fad8dd4633
      https://github.com/llvm/llvm-project/commit/9170fa58082e368f8b6ed8e0e6ef88fad8dd4633
  Author: Markus Böck <markus.bock+llvm at nextsilicon.com>
  Date:   2023-07-14 (Fri, 14 Jul 2023)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/include/mlir/Target/LLVMIR/ModuleImport.h
    M mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/lib/Dialect/LLVMIR/IR/LLVMInterfaces.cpp
    M mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp
    M mlir/lib/Target/LLVMIR/LoopAnnotationImporter.cpp
    M mlir/lib/Target/LLVMIR/LoopAnnotationImporter.h
    M mlir/lib/Target/LLVMIR/LoopAnnotationTranslation.cpp
    M mlir/lib/Target/LLVMIR/LoopAnnotationTranslation.h
    M mlir/lib/Target/LLVMIR/ModuleImport.cpp
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    M mlir/test/Dialect/LLVMIR/inlining.mlir
    M mlir/test/Dialect/LLVMIR/invalid.mlir
    M mlir/test/Dialect/LLVMIR/loop-metadata.mlir
    M mlir/test/Dialect/LLVMIR/tbaa-invalid.mlir
    M mlir/test/Target/LLVMIR/Import/metadata-loop.ll
    M mlir/test/Target/LLVMIR/loop-metadata.mlir
    M mlir/test/mlir-tblgen/llvm-intrinsics.td
    M mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp

  Log Message:
  -----------
  [mlir][LLVM] Convert access group metadata to using attributes instead of ops

Using MLIR attributes instead of metadata has many advantages:
* No indirection: Attributes can simply refer to each other seemlessly without having to use the indirection of `SymbolRefAttr`. This also gives us correctness by construction in a lot of places as well
* Multithreading safe: The Attribute infrastructure gives us thread-safety for free. Creating operations and inserting them into a block is not thread-safe. This is a major use case for e.g. the inliner in MLIR which runs in parallel
* Easier to create: There is no need for a builder or a metadata region

This patch therefore does exactly that. It leverages the new distinct attributes to create distinct access groups in a deterministic and threadsafe manner.

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




More information about the All-commits mailing list