Skip to content

Commit 7d3682f

Browse files
stefan-iligcbot
authored andcommitted
Disable InterpreterPatternMatching
By default disable InterpreterPatternMatching due to performance reasons. Recompilation will be still triggered in some cases, but now based on register pressure.
1 parent 24c1b83 commit 7d3682f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

IGC/Compiler/CISACodeGen/MatchCommonKernelPatterns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ bool MatchCommonKernelPatterns::runOnFunction(Function &F) {
3737
Ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
3838

3939
// Check if F is part of interpreter pattern.
40-
if (IGC_IS_FLAG_ENABLED(EnableInterpreterPatternMatching) && !Ctx->platform.isCoreXE3())
40+
if (IGC_IS_FLAG_ENABLED(EnableInterpreterPatternMatching))
4141
if (isInterpreterPattern(F))
4242
Ctx->m_kernelsWithForcedRetry.push_back(&F);
4343

IGC/Compiler/tests/MatchCommonKernelPatterns/interpreter-typed-pointers.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
8-
;
98

10-
; RUN: igc_opt --match-common-kernel-patterns --print-codegencontext --platformdg2 < %s 2>&1 | FileCheck %s --check-prefix=CHECK-V1
9+
; REQUIRES: regkeys
10+
; RUN: igc_opt --match-common-kernel-patterns --regkey EnableInterpreterPatternMatching=1 --print-codegencontext --platformdg2 < %s 2>&1 | FileCheck %s --check-prefix=CHECK-V1
1111
; CHECK-V1: Kernel with forced retry: kernel_interpreter_v1
1212

13-
; RUN: igc_opt --match-common-kernel-patterns --print-codegencontext --platformdg2 < %s 2>&1 | FileCheck %s --check-prefix=CHECK-V2
13+
; RUN: igc_opt --match-common-kernel-patterns --regkey EnableInterpreterPatternMatching=1 --print-codegencontext --platformdg2 < %s 2>&1 | FileCheck %s --check-prefix=CHECK-V2
1414
; CHECK-V2: Kernel with forced retry: kernel_interpreter_v2
1515

1616
define spir_kernel void @kernel_interpreter_v1(i32 addrspace(4)* align 4 %addr1, i32 %op1, <8 x i32> %r0, <8 x i32> %payloadHeader) #0 {

IGC/Compiler/tests/MatchCommonKernelPatterns/interpreter.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
;============================ end_copyright_notice =============================
88
;
99

10-
; REQUIRES: llvm-14-plus
11-
; RUN: igc_opt --opaque-pointers --match-common-kernel-patterns --print-codegencontext --platformdg2 < %s 2>&1 | FileCheck %s --check-prefix=CHECK-V1
10+
; REQUIRES: llvm-14-plus, regkeys
11+
; RUN: igc_opt --opaque-pointers --match-common-kernel-patterns --regkey EnableInterpreterPatternMatching=1 --print-codegencontext --platformdg2 < %s 2>&1 | FileCheck %s --check-prefix=CHECK-V1
1212
; CHECK-V1: Kernel with forced retry: kernel_interpreter_v1
1313

14-
; RUN: igc_opt --opaque-pointers --match-common-kernel-patterns --print-codegencontext --platformdg2 < %s 2>&1 | FileCheck %s --check-prefix=CHECK-V2
14+
; RUN: igc_opt --opaque-pointers --match-common-kernel-patterns --regkey EnableInterpreterPatternMatching=1 --print-codegencontext --platformdg2 < %s 2>&1 | FileCheck %s --check-prefix=CHECK-V2
1515
; CHECK-V2: Kernel with forced retry: kernel_interpreter_v2
1616

1717
define spir_kernel void @kernel_interpreter_v1(ptr addrspace(4) align 4 %addr1, i32 %op1, <8 x i32> %r0, <8 x i32> %payloadHeader) #0 {

IGC/common/igc_flags.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ DECLARE_IGC_REGKEY(bool, EnableCustomLoopVersioning, true, "Enable IGC to do cus
513513
DECLARE_IGC_REGKEY(bool, DisableMCSOpt, false, "Disable IGC to run MCS optimization", false)
514514
DECLARE_IGC_REGKEY(bool, DisableGatingSimilarSamples, false, "Disable Gating of similar sample instructions", false)
515515
DECLARE_IGC_REGKEY(bool, EnableSoftwareStencil, false, "Enable software stencil for PS.", false)
516-
DECLARE_IGC_REGKEY(bool, EnableInterpreterPatternMatching, true,
516+
DECLARE_IGC_REGKEY(bool, EnableInterpreterPatternMatching, false,
517517
"Enable Interpreter pattern matching and force retry if the pattern was found.", false)
518518
DECLARE_IGC_REGKEY(bool, EnableSumFractions, false, "Enable SumFractions optimization in CustomUnsafeOptPass.", false)
519519
DECLARE_IGC_REGKEY(bool, EnableExtractCommonMultiplier, false,

0 commit comments

Comments
 (0)