Skip to content

Commit d5519a5

Browse files
committed
remove calling convention updates to func.func
1 parent b39e055 commit d5519a5

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

mlir/lib/Conversion/GPUToLLVMSPV/GPUToLLVMSPV.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -385,19 +385,6 @@ struct GPUToLLVMSPVConversionPass final
385385
if (failed(applyPartialConversion(getOperation(), target,
386386
std::move(patterns))))
387387
signalPassFailure();
388-
389-
// `func.func`s are not handled by the lowering, so need a proper calling
390-
// convention set separately.
391-
getOperation().walk([](LLVM::LLVMFuncOp f) {
392-
if (f.getCConv() == LLVM::CConv::C) {
393-
f.setCConv(LLVM::CConv::SPIR_FUNC);
394-
}
395-
});
396-
getOperation().walk([](LLVM::CallOp c) {
397-
if (c.getCConv() == LLVM::CConv::C) {
398-
c.setCConv(LLVM::CConv::SPIR_FUNC);
399-
}
400-
});
401388
}
402389
};
403390
} // namespace

mlir/test/Conversion/GPUToLLVMSPV/gpu-to-llvm-spv.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,11 @@ gpu.module @kernels {
538538
func.call @no_address_spaces_callee(%arg0, %arg1) : (memref<2x2xf32>, memref<4xf32>) -> ()
539539
gpu.return
540540
}
541-
// CHECK-OPENCL-LABEL: llvm.func spir_funccc @no_address_spaces_callee(
541+
// CHECK-OPENCL-LABEL: llvm.func @no_address_spaces_callee(
542542
// CHECK-OPENCL-SAME: %{{[a-zA-Z_][a-zA-Z0-9_]*}}: !llvm.ptr<1>
543543
// CHECK-OPENCL-SAME: %{{[a-zA-Z_][a-zA-Z0-9_]*}}: !llvm.ptr<1>
544544
// CHECK-OPENCL: [[C0:%.*]] = llvm.mlir.constant(0 : i32) : i32
545-
// CHECK-OPENCL: llvm.call spir_funccc @_Z12get_group_idj([[C0]]) {
545+
// CHECK-OPENCL: llvm.call @_Z12get_group_idj([[C0]]) {
546546
// CHECK-OPENCL: [[LD:%.*]] = llvm.load
547547
// CHECK-OPENCL: llvm.store [[LD]]
548548
func.func @no_address_spaces_callee(%arg0: memref<2x2xf32>, %arg1: memref<4xf32>) {

0 commit comments

Comments
 (0)