Skip to content

Commit 4adee35

Browse files
ichenkaiigcbot
authored andcommitted
Enable Dot and Add Ops to Dp4a Ops Optimization
Enable Dot and Add Ops to Dp4a Ops Optimization.
1 parent 6cfe171 commit 4adee35

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

IGC/Compiler/CustomSafeOptPass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void CustomSafeOptPass::visitShuffleIndex(llvm::CallInst* I)
378378
// %id317- = call i32 @llvm.genx.GenISA.dp4a.ss.i32(i32 %id213-, i32 %267, i32 %321)
379379
void CustomSafeOptPass::mergeDotAddToDp4a(llvm::CallInst* I)
380380
{
381-
if (!IGC_IS_FLAG_ENABLED(EnableDotAddToDp4aMerge))
381+
if (IGC_IS_FLAG_ENABLED(DisableDotAddToDp4aMerge))
382382
return;
383383

384384
// found %id213- = call i32 @llvm.genx.GenISA.dp4a.ss.i32(i32 0, i32 %305, i32 %345)

IGC/Compiler/tests/CustomSafeOptPass/DotAddToDp4a.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
; SPDX-License-Identifier: MIT
66
;
77
;============================ end_copyright_notice =============================
8-
; REQUIRES: regkeys
98
;
10-
; RUN: igc_opt --platformdg2 --regkey EnableDotAddToDp4aMerge=1 -igc-custom-safe-opt -S < %s --dce | FileCheck %s
9+
; RUN: igc_opt --platformdg2 -igc-custom-safe-opt -S < %s --dce | FileCheck %s
1110
; ------------------------------------------------
1211
; CustomSafeOptPass: DotAddToDp4a
1312
; ------------------------------------------------
1413
define void @test_DotAddToDp4a(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f) {
1514
; CHECK-LABEL: @test_DotAddToDp4a(
1615
; CHECK: [[TMP1:%.*]] = call i32 @llvm.genx.GenISA.dp4a.ss.i32(i32 0, i32 %a, i32 %b)
16+
; CHECK: [[TMP2:%.*]] = call i32 @llvm.genx.GenISA.dp4a.ss.i32(i32 [[TMP1]], i32 %c, i32 %d)
17+
; CHECK: [[TMP3:%.*]] = call i32 @llvm.genx.GenISA.dp4a.ss.i32(i32 [[TMP2]], i32 %e, i32 %f)
1718
;
1819
%1 = call i32 @llvm.genx.GenISA.dp4a.ss.i32(i32 0, i32 %a, i32 %b)
1920
%2 = call i32 @llvm.genx.GenISA.dp4a.ss.i32(i32 0, i32 %c, i32 %d)

IGC/common/igc_flags.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ DECLARE_IGC_REGKEY(bool, EnableGEPLSR, true, "Enables GEP Loop Strength Reductio
289289
DECLARE_IGC_REGKEY(DWORD, GEPLSRThresholdRatio, 100, "Ratio for register pressure threshold in GEP Loop Strength Reduction pass", false)
290290
DECLARE_IGC_REGKEY(bool, EnableGEPLSRToPreheader, true, "Enables reduction to loop's preheader in GEP Loop Strength Reduction pass", false)
291291
DECLARE_IGC_REGKEY(DWORD, FPRoundingModeCoalescingMaxDistance, 20, "Max distance in instructions for reordering FP instructions with common rounding mode", false)
292-
DECLARE_IGC_REGKEY(bool, EnableDotAddToDp4aMerge, false, "Enable Dot and Add ops to Dp4a merge optimization.", false)
292+
DECLARE_IGC_REGKEY(bool, DisableDotAddToDp4aMerge, false, "Disable Dot and Add ops to Dp4a merge optimization.", false)
293293
DECLARE_IGC_REGKEY(bool, DisableInvalidateRTStackAfterLastRead, false, "Disables L1 cache invalidation after the last read of the RT stack. Affects rayqueries only", false)
294294

295295
DECLARE_IGC_GROUP("Shader debugging")

0 commit comments

Comments
 (0)