[all-commits] [llvm/llvm-project] 5fc576: [MLIR][LLVM] Exporter skip over inlined frame with...

Billy Zhu via All-commits all-commits at lists.llvm.org
Fri May 3 07:31:24 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5fc576956e3b47708e8b405d57cefddd945a43d9
      https://github.com/llvm/llvm-project/commit/5fc576956e3b47708e8b405d57cefddd945a43d9
  Author: Billy Zhu <billyzhu at modular.com>
  Date:   2024-05-03 (Fri, 03 May 2024)

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

  Log Message:
  -----------
  [MLIR][LLVM] Exporter skip over inlined frame without debug scope (#90915)

Followup to #90759.

Instead of just returning null when the caller scope is not
translatable, "jump over" the current caller scope and use the outer
scope as the caller if that is available. This means that in an inlined
call stack if there are frames without debug scope, those frames are
skipped to preserve what is available. In the original example where
```
func A {
  foo loc(fused<#A>["a":1:1])
}
func B {
  call @A loc("b":1:1)
}
func C {
  call @B loc(fused<#C>["c":1:1])
}
```
is inlined into
```
func C {
  foo loc(callsite(
            callsite(fused<#A>["a":1:1] at loc("b":1:1))
           at
            fused<#C>["c":1:1]))
}
```
The translated result would be `!1`:
```
!0 = !DILocation(line: 1, column: 1, scope: !C)
!1 = !DILocation(line: 1, column: 1, scope: !A, inlinedAt: !0)
```

This has a neat benefit in maintaining callsite associativity: No matter
if we have `callsite(callsite(A at B) at C)` or `callsite(A at
callsite(B at C))`, the translation now is the same. The previous
solution did not provide this guarantee, which meant the callsite
construction would somehow impact this translation.



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