[all-commits] [llvm/llvm-project] 2ea60f: [MLIR][LLVM] Fuse Scope into CallsiteLoc Callee (#...

Billy Zhu via All-commits all-commits at lists.llvm.org
Wed Dec 6 00:13:25 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2ea60f41972dcb3c704c0b31a65a620ffcd9d4f6
      https://github.com/llvm/llvm-project/commit/2ea60f41972dcb3c704c0b31a65a620ffcd9d4f6
  Author: Billy Zhu <billyzhu at modular.com>
  Date:   2023-12-06 (Wed, 06 Dec 2023)

  Changed paths:
    M mlir/lib/Target/LLVMIR/DebugImporter.cpp
    M mlir/lib/Target/LLVMIR/DebugTranslation.cpp
    M mlir/test/Target/LLVMIR/Import/debug-info.ll
    M mlir/test/Target/LLVMIR/llvmir-debug.mlir

  Log Message:
  -----------
  [MLIR][LLVM] Fuse Scope into CallsiteLoc Callee (#74546)

There's an issue in the translator today where, for a CallsiteLoc, if
the callee does not have a DI scope (perhaps due to compile options or
optimizations), it may get propagated the DI scope of its callsite's
parent function, which will create a non-existent DILocation combining
line & col number from one file, and the filename from another.

The root problem is we cannot propagate the parent scope when
translating the callee location, as it no longer applies to inlined
locations (see code diff and hopefully this will make sense).

To facilitate this, the importer is also changed so that callee scopes
are fused with the callee FileLineCol loc, instead of on the Callsite
loc itself. This comes with the benefit that we now have a symmetric
Callsite loc representation. If we required the callee scope be always
annotated on the Callsite loc, it would be hard for generic inlining
passes to maintain that, since it would have to somehow understand the
semantics of the fused metadata and pull it out while inlining.




More information about the All-commits mailing list