[IRGen] Change annotation metadata to support inserting tuple of strings into annotat...
authorZain Jaffal <z_jaffal@apple.com>
Tue, 9 May 2023 14:15:13 +0000 (17:15 +0300)
committerZain Jaffal <z_jaffal@apple.com>
Tue, 9 May 2023 14:51:28 +0000 (17:51 +0300)
commit5d3a8842295e8ff9c8c1c98e2acf5fff76b3a2f8
tree86a948aedc68a129bb28d9b3810689f47b7d37d9
parent0574a4be879e07b48ba9be8d63eebba49a04dfe8
[IRGen] Change annotation metadata to support inserting tuple of strings into annotation metadata array.

Annotation metadata supports adding singular annotation strings to annotation block. This patch adds the ability to insert a tuple of strings into the metadata array.

The idea here is that each tuple of strings represents a piece of information that can be all related. It makes it easier to parse through related metadata information given it will be contained in one tuple.
For example in remarks any pass that implements annotation remarks can have different type of remarks and pass additional information for each.

The original behaviour of annotation remarks is preserved here and we can mix tuple annotations and single annotations for the same instruction.

Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D148328
llvm/docs/LangRef.rst
llvm/include/llvm/IR/Instruction.h
llvm/include/llvm/IR/Metadata.h
llvm/lib/CodeGen/BasicBlockSections.cpp
llvm/lib/CodeGen/MachineFunction.cpp
llvm/lib/IR/Metadata.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
llvm/lib/Transforms/Utils/MemoryOpRemark.cpp
llvm/test/Verifier/annotation-metadata.ll