Skip to content

Commit dc6552b

Browse files
pkwasnie-inteligcbot
authored andcommitted
enable RemoveUnusedIdImplicitArguments for Xe family
RemoveUnusedIdImplicitArguments is an option to remove global_id_offset and enqueued_local_size from kernel's implicit argument if they are unused (true if kernel does not use get_global_id()). Enable this option by default for Xe family.
1 parent 1a0c429 commit dc6552b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2454,7 +2454,7 @@ namespace IGC
24542454
arg.getArgType() == KernelArg::ArgType::IMPLICIT_BUFFER_SIZE) &&
24552455
arg.getArg()->use_empty();
24562456

2457-
if (IGC_IS_FLAG_ENABLED(RemoveUnusedIdImplicitArguments))
2457+
if (m_Context->platform.allowRemovingUnusedImplicitArguments())
24582458
{
24592459
IsUnusedArg |=
24602460
(arg.getArgType() == KernelArg::ArgType::IMPLICIT_PAYLOAD_HEADER || // contains global_id_offset

IGC/Compiler/CISACodeGen/Platform.hpp

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

1900+
bool allowRemovingUnusedImplicitArguments() const
1901+
{
1902+
if (IGC_IS_FLAG_SET(RemoveUnusedIdImplicitArguments))
1903+
return IGC_IS_FLAG_ENABLED(RemoveUnusedIdImplicitArguments);
1904+
1905+
return isCoreChildOf(IGFX_XE_HP_CORE) && !isCoreChildOf(IGFX_XE2_HPG_CORE);
1906+
}
1907+
19001908
};
19011909
}//namespace IGC

0 commit comments

Comments
 (0)