[mlir][llvm] Store memory op metadata using op attributes.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Fri, 10 Feb 2023 14:22:54 +0000 (15:22 +0100)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Fri, 10 Feb 2023 14:27:25 +0000 (15:27 +0100)
commitfef08da4b75fc751c6117df2a0213a0b075d05f5
tree4d79372cbd1fc32f18b3852da2c5607efe196aae
parent067a5c68845c13d45e85ec9eaa11d2b2d829bab4
[mlir][llvm] Store memory op metadata using op attributes.

The revision introduces operation attributes to store tbaa metadata on
load and store operations rather than relying using dialect attributes.
At the same time, the change also ensures the provided getters and
setters instead are used instead of a string based lookup. The latter
is done for the tbaa, access groups, and alias scope attributes.

The goal of this change is to ensure the metadata attributes are only
placed on operations that have the corresponding operation attributes.
This is imported since only these operations later on translate these
attributes to LLVM IR. Dialect attributes placed on other operations
are lost during the translation.

Reviewed By: vzakhari, Dinistro

Differential Revision: https://reviews.llvm.org/D143654
12 files changed:
flang/lib/Optimizer/CodeGen/TBAABuilder.cpp
flang/test/Fir/tbaa.fir
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMIRToLLVMTranslation.cpp
mlir/lib/Target/LLVMIR/LoopAnnotationTranslation.cpp
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/test/Dialect/LLVMIR/tbaa-invalid.mlir
mlir/test/Target/LLVMIR/Import/import-failure.ll
mlir/test/Target/LLVMIR/tbaa.mlir