[llvm] [AllocToken] Introduce llvm.alloc.token.id intrinsic (PR #163632)

Florian Mayer via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 15 17:07:48 PDT 2025


================
@@ -359,11 +384,22 @@ bool AllocToken::instrumentFunction(Function &F) {
   }
 
   bool Modified = false;
-  for (auto &[CB, Func] : AllocCalls)
-    Modified |= replaceAllocationCall(CB, Func, ORE, TLI);
 
-  if (Modified)
-    NumFunctionsInstrumented++;
+  if (!AllocCalls.empty()) {
+    for (auto &[CB, Func] : AllocCalls)
+      Modified |= replaceAllocationCall(CB, Func, ORE, TLI);
+    if (Modified)
+      NumFunctionsModified++;
+  }
+
+  if (!IntrinsicInsts.empty()) {
+    for (auto *II : IntrinsicInsts) {
----------------
fmayer wrote:

nit remove braces

https://github.com/llvm/llvm-project/pull/163632


More information about the llvm-commits mailing list