Skip to content

Commit b5c4862

Browse files
jaladreipsigcbot
authored andcommitted
Disable spill compaction in retry
Disable spill compaction in retry
1 parent f6c0fb7 commit b5c4862

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

IGC/Compiler/CodeGenContext.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ namespace IGC
3636
bool allowLargeGRF;
3737
bool allowLoadSinking;
3838
bool forceIndirectCallsInSyncRT;
39+
bool allowRaytracingSpillCompaction;
3940
unsigned nextState;
4041
};
4142

4243
static const RetryState RetryTable[] = {
43-
// adrCl licm codSk AdrSk Slice PrivM VISAP URBWr Coals GRF loadSk, SyncRT
44-
{ false, true, true, false, false, true, true, true, true, false, false, false, 1 },
45-
{ true, false, true, true, true, false, false, false, false, true, true, true, 500 }
44+
// adrCl licm codSk AdrSk Slice PrivM VISAP URBWr Coals GRF loadSk, SyncRT, compactspills
45+
{ false, true, true, false, false, true, true, true, true, false, false, false, true, 1 },
46+
{ true, false, true, true, true, false, false, false, false, true, true, true, false, 500 }
4647
};
4748

4849
static constexpr size_t RetryTableSize = sizeof(RetryTable) / sizeof(RetryState);
@@ -162,6 +163,16 @@ namespace IGC
162163
return RetryTable[id].forceIndirectCallsInSyncRT;
163164
}
164165

166+
bool RetryManager::AllowRaytracingSpillCompaction() const
167+
{
168+
if (IGC_IS_FLAG_ENABLED(AllowSpillCompactionOnRetry)) // allow spill compaction on retry
169+
return true;
170+
171+
unsigned id = GetRetryId();
172+
IGC_ASSERT(id < RetryTableSize);
173+
return RetryTable[id].allowRaytracingSpillCompaction;
174+
}
175+
165176
bool RetryManager::AllowLoadSinking(Function* F) const
166177
{
167178
unsigned id = GetPerFuncRetryStateId(F);

IGC/Compiler/CodeGenPublic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ namespace IGC
776776
bool AllowConstantCoalescing(llvm::Function* F = nullptr) const;
777777
bool AllowLargeGRF(llvm::Function* F = nullptr) const;
778778
bool ForceIndirectCallsInSyncRT() const;
779+
bool AllowRaytracingSpillCompaction() const;
779780
bool AllowLoadSinking(llvm::Function* F = nullptr) const;
780781
void SetFirstStateId(int id);
781782
bool IsFirstTry() const;

IGC/common/igc_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ DECLARE_IGC_GROUP("Raytracing Options")
962962
DECLARE_IGC_REGKEY(bool, DisableLateRemat, false, "Disable quick remats to avoid some spills", true)
963963
DECLARE_IGC_REGKEY(DWORD, RematThreshold, 6, "Tunes how aggresively we should remat values into continuations", true)
964964
DECLARE_IGC_REGKEY(bool, DisableCompactifySpills, false, "Just emit spill/fill at the point of def/use", true)
965+
DECLARE_IGC_REGKEY(bool, AllowSpillCompactionOnRetry, false, "Allow spill compaction on retry - may increase spills", true)
965966
DECLARE_IGC_REGKEY(bool, EnableHoistRemat, false, "Hoist rematerialized instructions to shader entry. Longer live ranges but common values fused.", true)
966967
DECLARE_IGC_REGKEY(bool, DisableRTGlobalsKnownValues, false, "load MaxBVHLevels from RTGlobals rather than assumming = 2", true)
967968
DECLARE_IGC_REGKEY(bool, DisableRaytracingIntrinsicAttributes, false, "Turn off noalias and dereferenceable attributes", true)

0 commit comments

Comments
 (0)