mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
Inliner should not add callgraph edges for intrinsic calls (PR22857)
The CallGraphNode function "addCalledFunction()" asserts that edges are not to intrinsics. This patch makes sure that the Inliner does not add such an edge to the callgraph. Fix for clang crash by assertion: https://llvm.org/bugs/show_bug.cgi?id=22857 Differential Revision: http://reviews.llvm.org/D8231 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231927 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -693,8 +693,15 @@ static void UpdateCallGraphAfterInlining(CallSite CS,
|
||||
// If the call was inlined, but then constant folded, there is no edge to
|
||||
// add. Check for this case.
|
||||
Instruction *NewCall = dyn_cast<Instruction>(VMI->second);
|
||||
if (!NewCall) continue;
|
||||
if (!NewCall)
|
||||
continue;
|
||||
|
||||
// We do not treat intrinsic calls like real function calls because we
|
||||
// expect them to become inline code; do not add an edge for an intrinsic.
|
||||
CallSite CS = CallSite(NewCall);
|
||||
if (CS && CS.getCalledFunction() && CS.getCalledFunction()->isIntrinsic())
|
||||
continue;
|
||||
|
||||
// Remember that this call site got inlined for the client of
|
||||
// InlineFunction.
|
||||
IFI.InlinedCalls.push_back(NewCall);
|
||||
|
Reference in New Issue
Block a user