[all-commits] [llvm/llvm-project] 8ea858: [CallPromotionUtil] See through function alias whe...

Mingming Liu via All-commits all-commits at lists.llvm.org
Tue Feb 6 09:22:47 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8ea858b96787578e814723a009f443808f446378
      https://github.com/llvm/llvm-project/commit/8ea858b96787578e814723a009f443808f446378
  Author: Mingming Liu <mingmingl at google.com>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/TypeMetadataUtils.h
    M llvm/lib/Analysis/TypeMetadataUtils.cpp
    M llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
    M llvm/lib/Transforms/Utils/CallPromotionUtils.cpp

  Log Message:
  -----------
  [CallPromotionUtil] See through function alias when devirtualizing a virtual call on an alloca. (#80736)

- Extract utility function from
`DevirtModule::tryFindVirtualCallTargets` [1], which sees through an alias to a function. Call this utility function in
the WPD callsite.
- For type profiling work, this helper function will be used by indirect-call-promotion pass to find the function pointer at a specified vtable offset (an example in [2])

[1] https://github.com/llvm/llvm-project/blob/b99163fe8feeacba7797d5479bbcd5d8f327dd2d/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp#L1069-L1082
[2] https://github.com/minglotus-6/llvm-project/blob/77a0ef12de82d11f448f7f9de6f2dcf87d9b74af/llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp#L347




More information about the All-commits mailing list