[CallGraph] Ignore callback uses
authorGiorgis Georgakoudis <georgakoudis1@llnl.gov>
Wed, 8 Jul 2020 05:43:24 +0000 (22:43 -0700)
committerGiorgis Georgakoudis <georgakoudis1@llnl.gov>
Tue, 14 Jul 2020 20:08:49 +0000 (13:08 -0700)
commitaef60af34ec3fd2a03b69d69b031e1d34070f6d5
tree53b6a4d81d7a8018e1bab9c7efc7c35a65e111d1
parentb98f414a04e19202669a4273e620bc12b5054413
[CallGraph] Ignore callback uses

Summary:
Ignore callback uses when adding a callback function
in the CallGraph. Callback functions are typically
created when outlining, e.g. for OpenMP, so they have
internal scope and linkage. They should not be added
to the ExternalCallingNode since they are only callable
by the specified caller function at creation time.

A CGSCC pass, such as OpenMPOpt, may need to update
the CallGraph by adding a new outlined callback function.
Without ignoring callback uses, adding breaks CGSCC
pass restrictions and results to a broken CallGraph.

Reviewers: jdoerfert

Subscribers: hiraditya, sstefan1, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83370
llvm/include/llvm/IR/Function.h
llvm/lib/Analysis/CallGraph.cpp
llvm/lib/IR/Function.cpp
llvm/test/Analysis/CallGraph/ignore-callback-uses.ll [new file with mode: 0644]