[Mlir-commits] [mlir] [MLIR][LLVM] Fuse Scope into CallsiteLoc Callee (PR #74546)

Billy Zhu llvmlistbot at llvm.org
Wed Jan 10 12:17:38 PST 2024


================
@@ -330,7 +330,10 @@ llvm::DILocation *DebugTranslation::translateLoc(Location loc,
   if (auto callLoc = dyn_cast<CallSiteLoc>(loc)) {
     // For callsites, the caller is fed as the inlinedAt for the callee.
     auto *callerLoc = translateLoc(callLoc.getCaller(), scope, inlinedAt);
-    llvmLoc = translateLoc(callLoc.getCallee(), scope, callerLoc);
+    llvmLoc = translateLoc(callLoc.getCallee(), nullptr, callerLoc);
----------------
zyx-billy wrote:

Hi, thanks for checking, yes the nullptr here is intentional so that we don't push the parent scope into the callee scope (in case the callee didn't have a scope, and accidentally takes on the caller scope). This is actually to service the semantics change introduced here, which is that debug locations of callees are annotated in the callee location, not the overall callsite location (following the motivation mentioned in the PR description).

For example, what previously might look like
```
fused<#callee>[callsite("foo.mlir":2:4 at fused<#sp0>["foo.mlir":28:5])]
```
should now look like
```
callsite(fused<#callee>["foo.mlir":2:4] at fused<#sp0>["foo.mlir":28:5])
```

Can you double check that your llvm dialect IR is generated as expected?

https://github.com/llvm/llvm-project/pull/74546


More information about the Mlir-commits mailing list