opt callgraph implementation


I am looking at the library related to the call graph. I noticed that in the source code CallGraph.cpp, there is a check inside the function addToCallGraph.

83 for (BasicBlock &BB : *F)
84 for (Instruction &I : BB) {
85 if (auto CS = CallSite(&I)) {
86 const Function *Callee = CS.getCalledFunction();
87 if (!Callee || !Intrinsic::isLeaf(Callee->getIntrinsicID()))
88 // Indirect calls of intrinsics are not allowed so no need to check.
89 // We can be more precise here by using TargetArg returned by
90 // Intrinsic::isLeaf.
91 Node->addCalledFunction(CS, CallsExternalNode.get());
92 else if (!Callee->isIntrinsic())
93 Node->addCalledFunction(CS, getOrInsertFunction(Callee));
94 }
95 }

In line 87 and line 92. There are two checks that will add the callee to the function. Could you please explain in detail why we need these two different checks. What does Intrinsic mean? Many Thanks