[all-commits] [llvm/llvm-project] 104105: [CallGraph][FIX] Ensure generic intrinsics are rep...

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Tue Jan 10 11:39:41 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 10410534696e1922cbed56b229d123b2db4acd8e
      https://github.com/llvm/llvm-project/commit/10410534696e1922cbed56b229d123b2db4acd8e
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2023-01-10 (Tue, 10 Jan 2023)

  Changed paths:
    M llvm/include/llvm/Analysis/CallGraph.h
    M llvm/include/llvm/IR/Intrinsics.h
    M llvm/lib/Analysis/CallGraph.cpp
    M llvm/lib/Analysis/CallGraphSCCPass.cpp
    M llvm/lib/Analysis/GlobalsModRef.cpp
    M llvm/lib/IR/Function.cpp
    M llvm/test/Analysis/CallGraph/ignore-assumelike-calls.ll
    M llvm/test/Analysis/CallGraph/non-leaf-intrinsics.ll
    M llvm/test/Transforms/GVN/intrinsics_in_cg.ll

  Log Message:
  -----------
  [CallGraph][FIX] Ensure generic intrinsics are represented in the CG

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. Debug intrinsics are
   still excluded.
 - 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

Differential Revision: https://reviews.llvm.org/D14119




More information about the All-commits mailing list