Closed PikachuHyA closed 1 week ago
CIR_TBAAAttr
.Why is the type of TBAA mlir::ArrayAttr
?
The introduction of the tbaa
attribute as OptionalAttr<SymbolRefArrayAttr>
is in the commit https://github.com/llvm/llvm-project/commit/edfefd7fc50b995c4dfd81d5f9db53c1a9e11580 . The follow-up changes made in https://github.com/llvm/llvm-project/commit/1dda134f85d4fab7ace7b9ec9b57a0319c14de8f further address this design choice, which changes tbaa
attribute as OptionalAttr<LLVM_TBAATagArrayAttr>
.
The rationale behind this decision stems from the following comment:
// LLVM IR currently does not support attaching more than one TBAA access tag
// to a memory accessing instruction. While supporting this in the future may
// be beneficial, for now we simply ignore the metadata if the MLIR operation
// has multiple access tags.
For additional context, please refer to ModuleTranslation.cpp#L1101-L1109.
In this patch, we use mlir::ArrayAttr
to simplify the TBAA attribute, allowing for a quicker landing of the patch. We will refine the TBAA attribute design in the next patch.
- In this patch, we use
mlir::ArrayAttr
to simplify the TBAA attribute, allowing for a quicker landing of the patch. We will refine the TBAA attribute design in the next patch.
I dislike optional
Anyways, I'm fine if this comes as incremental work though. Thanks
This is the first patch to support TBAA, following the discussion at https://github.com/llvm/clangir/pull/1076#discussion_r1835031415
decorateOperationWithTBAA
CIRGenTBAA
CIR_TBAAAttr
with empty bodyCIR_TBAAAttr
toLoadOp
andStoreOp