File tree Expand file tree Collapse file tree 3 files changed +59
-0
lines changed
Optimizer/OpenCLPasses/JointMatrixFuncsResolutionPass
tests/JointMatrixFuncsResolutionPass/ErrorsReporting Expand file tree Collapse file tree 3 files changed +59
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,14 @@ bool JointMatrixFuncsResolutionPass::runOnModule(Module &M)
226226 Changed |= runOnFunction (F);
227227 }
228228
229+ for (const auto & ResolvedFunctionPair : ResolvedFuncSignatures) {
230+ Function *OriginalFunction = ResolvedFunctionPair.first ;
231+
232+ if (OriginalFunction->use_empty ()) {
233+ OriginalFunction->eraseFromParent ();
234+ }
235+ }
236+
229237 return Changed;
230238}
231239
Original file line number Diff line number Diff line change 1+ ;=========================== begin_copyright_notice ============================
2+ ;
3+ ; Copyright (C) 2024 Intel Corporation
4+ ;
5+ ; SPDX-License-Identifier: MIT
6+ ;
7+ ;============================ end_copyright_notice =============================
8+ ;
9+ ; RUN: igc_opt -igc-joint-matrix-resolution --platformpvc -S 2>&1 < %s | FileCheck %s
10+ ; ------------------------------------------------
11+ ; JointMatrixFuncsResolutionPass - Verify whether the original function is removed
12+ ; after resolving function with joint matrix arguments
13+ ; into new function.
14+ ; ------------------------------------------------
15+
16+ ; CHECK-NOT: define internal spir_func void @test
17+ ; CHECK: define internal spir_func void @test_resolved
18+
19+ %"struct.sycl::_V1::ext::oneapi::experimental::matrix::joint_matrix" = type { %spirv.JointMatrixINTEL._float_8_16_3_3_2 addrspace (1 )* }
20+ %spirv.JointMatrixINTEL._float_8_16_3_3_2 = type opaque
21+
22+ ;Function Attrs: nounwind
23+ define internal spir_func void @test (%"struct.sycl::_V1::ext::oneapi::experimental::matrix::joint_matrix" addrspace (4 )* nocapture align 8 dereferenceable (8 ) %m ){
24+ ret void
25+ }
Original file line number Diff line number Diff line change 1+ ;=========================== begin_copyright_notice ============================
2+ ;
3+ ; Copyright (C) 2024 Intel Corporation
4+ ;
5+ ; SPDX-License-Identifier: MIT
6+ ;
7+ ;============================ end_copyright_notice =============================
8+ ;
9+ ; REQUIRES: opaque-ptr-fix, llvm-14-plus
10+ ; RUN: igc_opt -igc-joint-matrix-resolution --platformpvc -S 2>&1 < %s | FileCheck %s
11+ ; ------------------------------------------------
12+ ; JointMatrixFuncsResolutionPass - Verify whether the original function is removed
13+ ; after resolving function with joint matrix arguments
14+ ; into new function.
15+ ; ------------------------------------------------
16+
17+ ; CHECK-NOT: define internal spir_func void @test
18+ ; CHECK: define internal spir_func void @test_resolved
19+
20+ %"struct.sycl::_V1::ext::oneapi::experimental::matrix::joint_matrix" = type { %spirv.JointMatrixINTEL._float_8_16_3_3_2 addrspace (1 )* }
21+ %spirv.JointMatrixINTEL._float_8_16_3_3_2 = type opaque
22+
23+ ;Function Attrs: nounwind
24+ define internal spir_func void @test (%"struct.sycl::_V1::ext::oneapi::experimental::matrix::joint_matrix" addrspace (4 )* nocapture align 8 dereferenceable (8 ) %m ){
25+ ret void
26+ }
You can’t perform that action at this time.
0 commit comments