Skip to content

Commit 632abb7

Browse files
committed
add more detail to the comment describing the bug
1 parent ad1374a commit 632abb7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mlir/lib/Conversion/GPUCommon/GPUOpsLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,9 +543,9 @@ LogicalResult GPUPrintfOpToVPrintfLowering::matchAndRewrite(
543543
// the device code, not the host code
544544
auto moduleOp = gpuPrintfOp->getParentOfType<gpu::GPUModuleOp>();
545545

546-
// Convert the location to a valid global location of type FileLineColLoc if
547-
// found else UnknownLoc. Remove any metadata from the location which is not
548-
// valid for a global location.
546+
// Create a valid global location removing any metadata attached to the
547+
// location as debug info metadata inside of a function cannot be used outside
548+
// of that function.
549549
Location globalLoc = loc->findInstanceOfOrUnknown<FileLineColLoc>();
550550

551551
auto vprintfType =

mlir/test/Conversion/GPUToNVVM/gpu-to-nvvm-debuginfo.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// CHECK-DAG: [[LOC:#[a-zA-Z0-9_]+]] = loc("foo.mlir":0:0)
1414
#loc = loc("foo.mlir":0:0)
1515

16-
gpu.module @test_module_56 {
16+
gpu.module @test_module_1 {
1717
// CHECK-DAG: llvm.mlir.global internal constant @[[$PRINT_GLOBAL0:[A-Za-z0-9_]+]]("Hello, world with location\0A\00") {addr_space = 0 : i32} loc([[LOC]])
1818
// CHECK-DAG: llvm.func @vprintf(!llvm.ptr, !llvm.ptr) -> i32 loc([[LOC]])
1919

0 commit comments

Comments
 (0)