aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
diff options
context:
space:
mode:
authorBilly Zhu <billyzhu@modular.com>2024-05-03 07:31:02 -0700
committerGitHub <noreply@github.com>2024-05-03 07:31:02 -0700
commit5fc576956e3b47708e8b405d57cefddd945a43d9 (patch)
treed699303f3d9ed5cf935313e61116be65c6deb130 /llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
parent69f1442302250a23fb981fb4d61159d50551f617 (diff)
downloadllvm-5fc576956e3b47708e8b405d57cefddd945a43d9.zip
llvm-5fc576956e3b47708e8b405d57cefddd945a43d9.tar.gz
llvm-5fc576956e3b47708e8b405d57cefddd945a43d9.tar.bz2
[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.
Diffstat (limited to 'llvm/lib/Transforms/Utils/BasicBlockUtils.cpp')
0 files changed, 0 insertions, 0 deletions