Skip to content

Commit

Permalink
CS loacl id uniform
Browse files Browse the repository at this point in the history
Only do uniform analysis for cs local IDs when it is linear walkOrder
and ID layout is linear. Skip TileY and QuadTile as their semantice and
implmentation needs to be clarified first.
  • Loading branch information
jgu222 authored and igcbot committed Jul 17, 2024
1 parent 82a6156 commit 1283e0c
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions IGC/Compiler/CISACodeGen/WIAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,14 @@ void WIAnalysisRunner::CS_checkLocalIDs(Function *F)
IGC_IS_FLAG_DISABLED(OverrideCsTileLayoutEnable))
return;

auto walkOrder = (CS_WALK_ORDER)IGC_GET_FLAG_VALUE(OverrideCsWalkOrder);
auto idLayout = (ThreadIDLayout)IGC_GET_FLAG_VALUE(OverrideCsTileLayout);
if (idLayout == ThreadIDLayout::TileY ||
idLayout == ThreadIDLayout::QuadTile) {
// Need clarification on semantics. Skip for now.
return;
}

Module *M = F->getParent();
uint32_t X = 0, Y = 0, Z = 0;
if (GlobalVariable *pX = M->getGlobalVariable("ThreadGroupSize_X")) {
Expand Down Expand Up @@ -2130,8 +2138,6 @@ void WIAnalysisRunner::CS_checkLocalIDs(Function *F)
m_localIDzUniform = true;
}

auto walkOrder = (CS_WALK_ORDER)IGC_GET_FLAG_VALUE(OverrideCsWalkOrder);
auto idLayout = (ThreadIDLayout)IGC_GET_FLAG_VALUE(OverrideCsTileLayout);
constexpr uint32_t simdSize = 32;
if (idLayout == ThreadIDLayout::X)
{
Expand Down Expand Up @@ -2194,15 +2200,6 @@ void WIAnalysisRunner::CS_checkLocalIDs(Function *F)
}
return;
}

bool isTileY = (idLayout == ThreadIDLayout::TileY &&
walkOrder == CS_WALK_ORDER::WO_YXZ);
bool isQuadTile = (idLayout == ThreadIDLayout::QuadTile &&
walkOrder == CS_WALK_ORDER::WO_XYZ);
if ((isTileY || isQuadTile) && ((X * Y) % simdSize) == 0) {
// combination of first and second dims is multiple of simd siz
m_localIDzUniform = true;
}
}

// Set IsLxUniform/IsLyUniform/IsLxUniform to true if they are uniform;
Expand Down

0 comments on commit 1283e0c

Please sign in to comment.