[PATCH] D141190: [CallGraph][FIX] Ensure generic intrinsics are represented in the CG

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 7 01:15:52 PST 2023


jdoerfert created this revision.
jdoerfert added reviewers: arsenm, tra, efriedma, sanjoy.
Herald added subscribers: bollu, hiraditya.
Herald added a project: All.
jdoerfert requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

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


https://reviews.llvm.org/D141190

Files:
  llvm/include/llvm/IR/IntrinsicInst.h
  llvm/include/llvm/IR/Intrinsics.h
  llvm/include/llvm/IR/Intrinsics.td
  llvm/lib/Analysis/CallGraph.cpp
  llvm/lib/Analysis/CallGraphSCCPass.cpp
  llvm/lib/Analysis/GlobalsModRef.cpp
  llvm/lib/IR/Function.cpp
  llvm/test/Analysis/CallGraph/ignore-assumelike-calls.ll
  llvm/test/Analysis/CallGraph/non-leaf-intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141190.487069.patch
Type: text/x-patch
Size: 11582 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230107/2bfc7f60/attachment.bin>


More information about the llvm-commits mailing list