aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Ayupov <aaupov@fb.com>2025-04-08 13:50:09 -0700
committerAmir Ayupov <aaupov@fb.com>2025-04-08 13:50:09 -0700
commitabfbac2b6d63ef0604f65e55999ecab6f7095cd6 (patch)
tree4d2efab7016188b3f577d6975c201ebffab91c37
parent144687ce25dfc0520ee33be24cae1fc88876d44b (diff)
downloadllvm-users/aaupov/spr/bolt-check-callprofile-annotation-in-buildcallgraph.zip
llvm-users/aaupov/spr/bolt-check-callprofile-annotation-in-buildcallgraph.tar.gz
llvm-users/aaupov/spr/bolt-check-callprofile-annotation-in-buildcallgraph.tar.bz2
Created using spr 1.3.4
-rw-r--r--bolt/lib/Core/BinaryFunctionCallGraph.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/bolt/lib/Core/BinaryFunctionCallGraph.cpp b/bolt/lib/Core/BinaryFunctionCallGraph.cpp
index 76fc524..5f99d00 100644
--- a/bolt/lib/Core/BinaryFunctionCallGraph.cpp
+++ b/bolt/lib/Core/BinaryFunctionCallGraph.cpp
@@ -252,6 +252,8 @@ buildCallGraph(BinaryContext &BC, CgFilterFunction Filter, bool CgFromPerfData,
for (MCInst &Inst : *BB) {
// Find call instructions and extract target symbols from each one.
+ // Check CallProfile annotation if the instruction is not recognized
+ // as a call, e.g. unknown control flow indirect jump.
if (BC.MIB->isCall(Inst) ||
BC.MIB->hasAnnotation(Inst, "CallProfile")) {
const CallInfoTy CallInfo = getCallInfo(BB, Inst);