[all-commits] [llvm/llvm-project] da8558: [CodeExtractor] Reset stale FuncRetVal in findInpu...

Steven Wu via All-commits all-commits at lists.llvm.org
Mon May 4 06:43:32 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: da855875ff6b023e4a77d9cdb9e6709a2e66c3fc
      https://github.com/llvm/llvm-project/commit/da855875ff6b023e4a77d9cdb9e6709a2e66c3fc
  Author: Steven Wu <stevenwu at apple.com>
  Date:   2026-05-04 (Mon, 04 May 2026)

  Changed paths:
    M llvm/lib/Transforms/Utils/CodeExtractor.cpp
    A llvm/test/Transforms/HotColdSplit/stale-funcretval-after-sever.ll

  Log Message:
  -----------
  [CodeExtractor] Reset stale FuncRetVal in findInputsOutputs (#195484)

HotColdSplitting calls findInputsOutputs once for cost analysis before
extractCodeRegion runs normalizeCFGForExtraction. The first call may set
FuncRetVal to a single-output value which severSplitPHINodesOfEntry then
moves back into the parent function. The second findInputsOutputs call
correctly finds zero outputs but leaves FuncRetVal pointing at the
parent's instruction, so the cold function emits a `ret` referencing a
value in another function and fails verification.

Reset FuncRetVal at the start of the selection block so each call
recomputes it from the current CFG.

rdar://176075761



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