Skip to content

Commit 433d89e

Browse files
committed
Fix incorrect function name.
1 parent fcd9801 commit 433d89e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

mlir/lib/Conversion/GPUToLLVMSPV/GPUToLLVMSPV.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ struct GPUToLLVMSPVConversionPass final
476476
populateGpuMemorySpaceAttributeConversions(converter);
477477
patterns.add<GPUPrintfOpToLLVMCallLowering>(converter, /*addressSpace=*/2,
478478
LLVM::cconv::CConv::SPIR_FUNC,
479-
"Z6printfPU3AS2Kcz");
479+
"_Z6printfPU3AS2Kcz");
480480

481481
if (failed(applyPartialConversion(getOperation(), target,
482482
std::move(patterns))))

mlir/test/Conversion/GPUToLLVMSPV/printf.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
gpu.module @test_module {
44
// CHECK: llvm.mlir.global internal constant @[[$PRINT_GLOBAL:[A-Za-z0-9_]+]]("Hello: %d\0A\00") {addr_space = 2 : i32}
5-
// CHECK: llvm.func spir_funccc @Z6printfPU3AS2Kcz(!llvm.ptr<2>, ...) -> i32
5+
// CHECK: llvm.func spir_funccc @_Z6printfPU3AS2Kcz(!llvm.ptr<2>, ...) -> i32
66
// CHECK-LABEL: llvm.func spir_funccc @test_printf
77
// CHECK: (%[[ARG0:.*]]: i32)
88
gpu.func @test_printf(%arg0: i32) {
99
// CHECK: %[[IMM0:.*]] = llvm.mlir.addressof @[[$PRINT_GLOBAL]] : !llvm.ptr<2>
1010
// CHECK-NEXT: %[[IMM2:.*]] = llvm.getelementptr %[[IMM0]][0, 0] : (!llvm.ptr<2>) -> !llvm.ptr<2>, !llvm.array<11 x i8>
11-
// CHECK-NEXT: %{{.*}} = llvm.call spir_funccc @Z6printfPU3AS2Kcz(%[[IMM2]], %[[ARG0]]) vararg(!llvm.func<i32 (ptr<2>, ...)>) : (!llvm.ptr<2>, i32) -> i32
11+
// CHECK-NEXT: %{{.*}} = llvm.call spir_funccc @_Z6printfPU3AS2Kcz(%[[IMM2]], %[[ARG0]]) vararg(!llvm.func<i32 (ptr<2>, ...)>) : (!llvm.ptr<2>, i32) -> i32
1212
gpu.printf "Hello: %d\n", %arg0 : i32
1313
gpu.return
1414
}

mlir/test/Integration/Dialect/XeVM/GPU/gpu_printf.mlir

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ module @test attributes {gpu.container_module} {
2222
%c1 = arith.constant 1 : index
2323
%c11 = arith.constant 11 : i32
2424
%c4 = arith.constant 4.0 : f32
25-
// CHECK: "Hello: 11"
25+
// CHECK: Hello: 11
26+
// CHECK: Hello: 4.000000
2627
gpu.launch_func @test_module::@test_printf blocks in (%c1, %c1, %c1) threads in (%c1, %c1, %c1) args(%c11 : i32, %c4 : f32)
2728
return
2829
}

0 commit comments

Comments
 (0)