[all-commits] [llvm/llvm-project] ac39d2: [MemProf] Don't mutate the function type when call...

Teresa Johnson via All-commits all-commits at lists.llvm.org
Fri Jul 11 11:34:05 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac39d26dc4a8bf442ad59d0df742ae38a4ff9aba
      https://github.com/llvm/llvm-project/commit/ac39d26dc4a8bf442ad59d0df742ae38a4ff9aba
  Author: Teresa Johnson <tejohnson at google.com>
  Date:   2025-07-11 (Fri, 11 Jul 2025)

  Changed paths:
    M llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
    A llvm/test/ThinLTO/X86/memprof_callee_type_mismatch.ll

  Log Message:
  -----------
  [MemProf] Don't mutate the function type when calling clone (#147829)

In rare cases the declaration of a function may not match its callsite
after function importing, when the declaration was imported from a
module where the function had void return type (presumably due to
incomplete types). Instead of using setCalledFunction() to change a call
to call its clone, which updates the call's function type as well, just
call setCalledOperand directly so the only thing changed is the function
target.

Note this can't happen for the other places where we call
setCalledFunction: FullLTO requires the cloned callee to be defined in
the same FullLTO merged module; ThinLTO memprof ICP calls an ICP
facility to first perform the promotion and that will be blocked if the
function type doesn't match the callsite (the new test explicitly tests
this latter case).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list