diff options
author | Prabhu Rajasekaran <prabhukr@google.com> | 2025-07-18 14:40:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-18 14:40:54 -0700 |
commit | 921c6dbecaf49e3ed24b94802f094cd7f61f1873 (patch) | |
tree | d25e45eb05da07ef36276a4fbc4d524285762253 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 6d8e53d4afe46608f47bcb014387c053829cdcf1 (diff) | |
download | llvm-921c6dbecaf49e3ed24b94802f094cd7f61f1873.zip llvm-921c6dbecaf49e3ed24b94802f094cd7f61f1873.tar.gz llvm-921c6dbecaf49e3ed24b94802f094cd7f61f1873.tar.bz2 |
[llvm] Introduce callee_type metadata
Introduce `callee_type` metadata which will be attached to the indirect
call instructions.
The `callee_type` metadata will be used to generate `.callgraph` section
described in this RFC:
https://lists.llvm.org/pipermail/llvm-dev/2021-July/151739.html
Reviewers: morehouse, petrhosek, nikic, ilovepi
Reviewed By: nikic, ilovepi
Pull Request: https://github.com/llvm/llvm-project/pull/87573
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index d481ad9..7f0c23b 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -3005,6 +3005,12 @@ static void combineMetadata(Instruction *K, const Instruction *J, case LLVMContext::MD_memprof: case LLVMContext::MD_callsite: break; + case LLVMContext::MD_callee_type: + if (!AAOnly) { + K->setMetadata(LLVMContext::MD_callee_type, + MDNode::getMergedCalleeTypeMetadata(KMD, JMD)); + } + break; case LLVMContext::MD_align: if (!AAOnly && (DoesKMove || !K->hasMetadata(LLVMContext::MD_noundef))) K->setMetadata( |