Intrinsics have historically been excluded from the call graph with an
exception of 3 special ones added at some point. This meant that passes
depending on the call graph needed to handle intrinsics explicitly as
the underlying assumption, namely that intrinsics can't call or modify
things, doesn't hold. We are slowly moving away from special handling of
intrinsics, or at least towards explicitly checking what intrinsics we
want to handle differently.
This patch:
- Includes most intrinsics in the call graph. "Assume-like" intrinsics are excluded. What assume-like means is a question for a later time.
- Fixes the annotations on patchpoint intrinsics as they can (and will) callback into the module.
- Removes the special handling of intrinsics in the GlobalsAA pass.
- Removes the IntrinsicInst::isLeaf method.
Properly
Fixes: https://github.com/llvm/llvm-project/issues/52706
See also:
https://discourse.llvm.org/t/intrinsics-are-not-special-stop-pretending-i-mean-it/67545
So this means that for example llvm.umax is part of the call graph but llvm.objectsize is not -- the intended logic here isn't clear to me.