[llvm] [ctxprof] Instrument direct calls to other things than Functions (PR #142657)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 12:22:16 PDT 2025


https://github.com/mtrofin created https://github.com/llvm/llvm-project/pull/142657

None

>From ff789ef889daa8de162cc492b21d8cefe1328de1 Mon Sep 17 00:00:00 2001
From: Mircea Trofin <mtrofin at google.com>
Date: Tue, 3 Jun 2025 12:21:47 -0700
Subject: [PATCH] [ctxprof] Instrument direct calls to other things than
 Functions

---
 llvm/include/llvm/IR/IntrinsicInst.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/IR/IntrinsicInst.h b/llvm/include/llvm/IR/IntrinsicInst.h
index 74bd22e70b619..20e667524fa0d 100644
--- a/llvm/include/llvm/IR/IntrinsicInst.h
+++ b/llvm/include/llvm/IR/IntrinsicInst.h
@@ -1536,7 +1536,7 @@ class InstrProfCallsite : public InstrProfCntrInstBase {
   static bool canInstrumentCallsite(const CallBase &CB) {
     return !CB.isInlineAsm() &&
            (CB.isIndirectCall() ||
-            (CB.getCalledFunction() && !CB.getCalledFunction()->isIntrinsic()));
+            (CB.getIntrinsicID() == Intrinsic::not_intrinsic));
   }
   LLVM_ABI Value *getCallee() const;
   LLVM_ABI void setCallee(Value *Callee);



More information about the llvm-commits mailing list