Skip to content

Commit 320a50a

Browse files
dlei6gigcbot
authored andcommitted
Flag EnableByValStructArgPromotion can enable/disable struct argument promotion
Flag is enabled by default, can be turned off for debugging and performance measurement purposes.
1 parent 1d50d7c commit 320a50a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

IGC/AdaptorCommon/LegalizeFunctionSignatures.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ inline Type* LegalizedIntVectorType(Module& M, Type* ty)
139139
// Returns true for small structures that only contain primitive types
140140
inline bool isPromotableStructType(Module& M, Type* ty, bool isReturnValue = false)
141141
{
142+
if (IGC_IS_FLAG_DISABLED(EnableByValStructArgPromotion))
143+
return false;
144+
142145
// We can separate promoting argument and return value sizes.
143146
// Return value is limited to 64-bits due to vISA stackcall conventions.
144147
// Argument is not limited to 64-bits, but can be adjusted to minimize spill.

IGC/common/igc_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ DECLARE_IGC_REGKEY(bool, EnableLTO, true, "Enable link time
376376
DECLARE_IGC_REGKEY(bool, EnableLTODebug, false, "Enable debug information for LTO", true)
377377
DECLARE_IGC_REGKEY(DWORD, FunctionControl, 0, "Control function inlining/subroutine/stackcall. See value defs in igc_flags.hpp.", true)
378378
DECLARE_IGC_REGKEY(bool, EnableStackCallFuncCall, false, "If enabled, the default function call mode will be set to stack call. Otherwise, subroutine call is used.", false)
379+
DECLARE_IGC_REGKEY(bool, EnableByValStructArgPromotion, true, "If enabled, byval/sret struct arguments are promoted to pass-by-value if possible.", true)
379380
DECLARE_IGC_REGKEY(bool, ForceInlineStackCallWithImplArg, true, "If enabled, stack calls that uses implicit args will be force inlined.", true)
380381
DECLARE_IGC_REGKEY(DWORD, FunctionCloningThreshold, 0,
381382
"Limits how many times functions can be cloned when called from multiple function groups." \

0 commit comments

Comments
 (0)