[llvm] [AllocToken] Introduce sanitize_alloc_token attribute and alloc_token metadata (PR #160131)
Marco Elver via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 24 07:45:34 PDT 2025
================
@@ -3025,6 +3025,10 @@ static void combineMetadata(Instruction *K, const Instruction *J,
// Preserve !nosanitize if both K and J have it.
K->setMetadata(Kind, JMD);
break;
+ case LLVMContext::MD_alloc_token:
+ // Preserve !alloc_token if both K and J have it.
+ K->setMetadata(Kind, JMD);
+ break;
----------------
melver wrote:
Let's merge only if they are equal for now - otherwise drop. This is the conservative choice, as I'm unsure if we can merge them in a sound way. And we don't want to pessimize optimizations either, so wouldn't want to prohibit simplifycfg folding identical branches if only the metadata differs (which itself is unlikely in practice).
https://github.com/llvm/llvm-project/pull/160131
More information about the llvm-commits
mailing list