Skip to content

Commit e70cd1f

Browse files
pkwasnie-inteligcbot
authored andcommitted
enable ShortImplicitPayloadHeader on Xe2
Compute workloads add following implicit arguments: 1. payloadHeader - 8 x i32 packing global_id_offset (3 x i32), local_size (3 x i32) and 2 x i32 reserved. 2. enqueued_local_size - 3 x i32 local_size is never used in favour of enqueued_local_size. In the end, payloadHeader has unused 20 bytes. This commit enables short payload header on Xe2.
1 parent ef5b2a5 commit e70cd1f

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

IGC/Compiler/CISACodeGen/Platform.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,6 +1897,14 @@ bool allowProceedBasedApproachForRayQueryDynamicRayManagementMechanism() const
18971897
return IGC_IS_FLAG_DISABLED(DisableProceedBasedApproachForRayQueryDynamicRayManagementMechanism);
18981898
}
18991899

1900+
bool allowShortImplicitPayloadHeader() const
1901+
{
1902+
if (IGC_IS_FLAG_SET(ShortImplicitPayloadHeader))
1903+
return IGC_IS_FLAG_ENABLED(ShortImplicitPayloadHeader);
1904+
1905+
return isCoreChildOf(IGFX_XE2_HPG_CORE) && !isCoreChildOf(IGFX_XE3_CORE);
1906+
}
1907+
19001908
bool allowRemovingUnusedImplicitArguments() const
19011909
{
19021910
if (IGC_IS_FLAG_SET(RemoveUnusedIdImplicitArguments))

IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncResolution.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@ Value* WIFuncResolution::getGlobalOffset(CallInst& CI)
512512
// Creates:
513513
// %globalOffset = extractelement <8 x i32> %payloadHeader, i32 %dim
514514

515-
auto Ty = IGC_IS_FLAG_ENABLED(ShortImplicitPayloadHeader) ? ImplicitArg::PAYLOAD_HEADER_SHORT : ImplicitArg::PAYLOAD_HEADER;
515+
auto Ty = getAnalysis<CodeGenContextWrapper>().getCodeGenContext()->platform.allowShortImplicitPayloadHeader()
516+
? ImplicitArg::PAYLOAD_HEADER_SHORT : ImplicitArg::PAYLOAD_HEADER;
516517
auto F = CI.getFunction();
517518
Value* V = m_implicitArgs.getImplicitArgValue(*F, Ty, m_pMdUtils);
518519
IGC_ASSERT(V != nullptr);

IGC/Compiler/Optimizer/OpenCLPasses/WIFuncs/WIFuncsAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ bool WIFuncsAnalysis::runOnFunction(Function& F)
9797
SmallVector<ImplicitArg::ArgType, ImplicitArg::NUM_IMPLICIT_ARGS> implicitArgs;
9898

9999
const bool RequirePayloadHeader = m_ctx->m_DriverInfo.RequirePayloadHeader();
100-
const auto PayloadHeaderType = IGC_IS_FLAG_ENABLED(ShortImplicitPayloadHeader) ? ImplicitArg::PAYLOAD_HEADER_SHORT : ImplicitArg::PAYLOAD_HEADER;
100+
const auto PayloadHeaderType = m_ctx->platform.allowShortImplicitPayloadHeader() ? ImplicitArg::PAYLOAD_HEADER_SHORT : ImplicitArg::PAYLOAD_HEADER;
101101

102102
// All OpenCL kernels receive R0 and Payload Header implicitly
103103
if (isEntryFunc(m_pMDUtils, &F))

0 commit comments

Comments
 (0)