[all-commits] [llvm/llvm-project] 62b27f: [CodeExtractor] Correctly propagate scope informat...

Felipe de Azevedo Piovezan via All-commits all-commits at lists.llvm.org
Tue Dec 6 11:26:55 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 62b27f893ecceade799df80b343d00851db250ba
      https://github.com/llvm/llvm-project/commit/62b27f893ecceade799df80b343d00851db250ba
  Author: Felipe de Azevedo Piovezan <fpiovezan at apple.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    M llvm/include/llvm/IR/DebugInfoMetadata.h
    M llvm/include/llvm/IR/DebugLoc.h
    M llvm/lib/IR/DebugLoc.cpp
    M llvm/lib/Transforms/Utils/CodeExtractor.cpp
    M llvm/test/Transforms/HotColdSplit/transfer-debug-info.ll

  Log Message:
  -----------
  [CodeExtractor] Correctly propagate scope information post extraction

When a new function "NewF" is created with instructions extracted from
another function "OldF", the CodeExtractor only preserves debug
line/column of the extracted instructions. However:

1. Any inlinedAt nodes are dropped.
2. The scope chain is replaced with a single node, the Subprogram of NewF.

Both of these are incorrect: most of the debug metadata from the
original instructions should be preserved. We only need to update the
Subprogram found at the scope of the last node of the inline chain; this
Subprogram used to be OldF but now should be NewF.

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




More information about the All-commits mailing list