[all-commits] [llvm/llvm-project] 1dda13: [mlir][flang] Convert TBAA metadata to an attribut...

Markus Böck via All-commits all-commits at lists.llvm.org
Wed Jul 19 07:43:07 PDT 2023


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

  Changed paths:
    M flang/include/flang/Optimizer/CodeGen/TBAABuilder.h
    M flang/lib/Optimizer/CodeGen/TBAABuilder.cpp
    M flang/lib/Optimizer/CodeGen/TypeConverter.cpp
    M flang/test/Fir/tbaa.fir
    M mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td
    M mlir/include/mlir/Dialect/LLVMIR/LLVMAttrs.h
    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/LLVMAttrs.cpp
    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/ModuleImport.cpp
    M mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
    M mlir/test/Dialect/LLVMIR/tbaa-invalid.mlir
    M mlir/test/Dialect/LLVMIR/tbaa-roundtrip.mlir
    M mlir/test/Target/LLVMIR/Import/import-failure.ll
    M mlir/test/Target/LLVMIR/Import/metadata-tbaa.ll
    M mlir/test/Target/LLVMIR/tbaa.mlir
    M mlir/test/mlir-tblgen/llvm-intrinsics.td
    M mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp

  Log Message:
  -----------
  [mlir][flang] Convert TBAA metadata to an attribute representation

The current representation of TBAA is the very last in-tree user of the `llvm.metadata` operation.
Using ops to model metadata has a few disadvantages:
* Building a graph has to be done through some weakly typed indirection mechanism such as `SymbolRefAttr`
* Creating the metadata has to be done through a builder within a metadata op.
* It is not multithreading safe as operation insertion into the same block is not thread-safe

This patch therefore converts TBAA metadata into an attribute representation, in a similar manner as it has been done for alias groups and access groups in previous patches.

This additionally has the large benefit of giving us more "correctness by construction" as it makes things like cycles in a TBAA graph, or references to an incorrectly typed metadata node impossible.

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




More information about the All-commits mailing list