Skip to content

Commit e749f1f

Browse files
ppogotovigcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 2ebc958
Remove DispatchOCLWGInLinearOrder flag. The DispatchOCLWGInLinearOrder flag is no longer needed because the workgroup vectorization order is fixed.
1 parent 0d8e8ce commit e749f1f

File tree

6 files changed

+16
-123
lines changed

6 files changed

+16
-123
lines changed

IGC/Compiler/CISACodeGen/WIAnalysis.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,9 @@ void WIAnalysisRunner::updateArgsDependency(llvm::Function* pF)
521521
// order (intel_reqd_workgroup_walk_order()) and work group size (reqd_work_group_size()),
522522
// we may derive that some of local IDs are uniform.
523523
bool localX_uniform = false, localY_uniform = false, localZ_uniform = false;
524-
if (!IsSubroutine)
524+
// DispatchOCLWGInLinearOrder should be removed after testing the guarded code.
525+
if (!IsSubroutine &&
526+
IGC_IS_FLAG_ENABLED(DispatchOCLWGInLinearOrder))
525527
{
526528
checkLocalIdUniform(pF, localX_uniform, localY_uniform, localZ_uniform);
527529
}
@@ -2150,8 +2152,8 @@ void WIAnalysisRunner::checkLocalIdUniform(
21502152
IsLzUniform = true;
21512153
}
21522154

2153-
2154-
if (WO_0 == 0 && WO_1 == 1 && WO_2 == 2)
2155+
if (IGC_IS_FLAG_ENABLED(DispatchOCLWGInLinearOrder) ||
2156+
(WO_0 == 0 && WO_1 == 1 && WO_2 == 2))
21552157
{
21562158
// linear order dispatch
21572159
uint32_t XxY = X * Y;

IGC/Compiler/Optimizer/CodeAssumption.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ void CodeAssumption::uniformHelper(Module* M)
7878
auto BB = CI->getParent();
7979
auto KF = BB->getParent();
8080

81-
if (!IsSGIdUniform(m_pMDUtils, modMD, KF))
81+
if (!IGC_IS_FLAG_ENABLED(DispatchOCLWGInLinearOrder) &&
82+
!IsSGIdUniform(m_pMDUtils, modMD, KF))
8283
continue;
8384

8485
// The value must be uniform. Using shuffle with index=0 to

IGC/Compiler/tests/LowerGEPForPrivMem/i8_alloca_limit.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ define spir_kernel void @WaveletDenoise(<4 x i8> addrspace(1)* %srcImage, <4 x i
2222
; CHECK-DG1-NEXT: entry:
2323
; CHECK-DG1-NEXT: [[I:%.*]] = extractelement <3 x i32> [[LOCALSIZE:%.*]], i64 0
2424
; CHECK-DG1-NEXT: [[TMP0:%.*]] = alloca <64 x i8>
25+
; CHECK-DG1-NEXT: [[TMP:%.*]] = alloca [16 x float]
26+
; CHECK-DG1-NEXT: [[TMP1:%.*]] = alloca <16 x float>
27+
; CHECK-DG1: [[ARRAYIDX165_1:%.*]] = getelementptr inbounds [16 x float], [16 x float]* [[TMP]]
2528
;
2629
; CHECK-DG2-LABEL: @WaveletDenoise(
2730
; CHECK-DG2-NEXT: entry:

IGC/Compiler/tests/WIAnalysis/local_id.ll

Lines changed: 0 additions & 119 deletions
This file was deleted.

IGC/common/igc_flags.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,11 @@ DECLARE_IGC_REGKEY(bool, DisableDynamicTextureFolding, false, "Disable Dynamic
261261
DECLARE_IGC_REGKEY(bool, DisableDynamicResInfoFolding, true, "Disable Dynamic ResInfo Instruction Folding", false)
262262
DECLARE_IGC_REGKEY(bool, DisableRectListOpt, false, "Disable Rect List optimization", false)
263263

264+
DECLARE_IGC_REGKEY(bool, DispatchOCLWGInLinearOrder, false, "If set, dispatch HW threads based on the linearized order of WI in a WG; \
265+
ie, let localSize=(lx, ly, lz), localId=(ix, iy, iz). And \
266+
linearLocalId = ix + lx * (iy + ly * iz); \
267+
And linear order means that \
268+
linearLocalId(lane[x+1])=linearLocalId(lane[x])+1", false)
264269
DECLARE_IGC_REGKEY(DWORD, EnableCodeAssumption, 1, \
265270
"If set (> 0), generate llvm.assume to help certain optimizations. It is OCL only for now. \
266271
Only 1 and 2 are valid. 2 will be 1 plus additional assumption. It also does other minor changes.", false)

documentation/configuration_flags.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ $ export IGC_ShaderDumpEnable=1
187187
| `DisableUniformAnalysis` | Setting this to 1/true adds a compiler switch to disable uniform_analysis | - |
188188
| `DisableUniformTypedAccess` | Setting this will disable uniform typed access handling | - |
189189
| `DisableUniformURBWrite` | Disables generation of uniform URB write messages | - |
190+
| `DispatchOCLWGInLinearOrder` | If set, dispatch HW threads based on the linearized order of WI in a WG;<br/> ie, let localSize=(lx, ly, lz), localId=(ix, iy, iz). And<br/> linearLocalId = ix + lx * (iy + ly * iz);<br/> And linear order means that<br/> linearLocalId(lane[x+1])=linearLocalId(lane[x])+1 | - |
190191
| `EnableAtomicBranch` | Enable Atomic branch optimization which break atomic into if/else with atomic and read based on the operation | - |
191192
| `EnableBitcastedLoadNarrowing` | Enable narrowing of vector loads in bitcasts patterns. | - |
192193
| `EnableBitcastedLoadNarrowingToScalar` | Enable narrowing of vector loads to scalar ones in bitcasts patterns. | - |

0 commit comments

Comments
 (0)