Skip to content

Commit 970ef6c

Browse files
jwarumzeigcbot
authored andcommitted
Sync Change
Sync Change
1 parent 6f80c8a commit 970ef6c

File tree

10 files changed

+1711
-0
lines changed

10 files changed

+1711
-0
lines changed

IGC/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ if (FCL_ENABLED)
256256
unset(_allowBifLink)
257257
endif()
258258

259+
259260
# Currently IGC uses 2 legacy SPIRV-LLVM-Translators
260261
# First one is located at gfx-driver/Source/IGC/AdaptorOCL/SPIRV
261262
# Second one is taken as prebuilt shared library called SPIRVDLL

IGC/Options/include/igc/Options/VCApiOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ def : PlainFlag<"no_vector_decomposition">, Alias<no_vector_decomposition>,
4444
def : PlainFlag<"no-vector-decomposition">, Alias<no_vector_decomposition>,
4545
HelpText<"Alias for -ze-no-vector-decomposition">;
4646

47+
def vc_fno_struct_splitting : PlainFlag<"fno-struct-splitting">,
48+
HelpText<"Disable StructSplitter pass">;
49+
4750
def vc_fno_jump_tables : PlainFlag<"fno-jump-tables">,
4851
HelpText<"Disable the use of jump tables for lowering switches">;
4952

IGC/VectorCompiler/include/vc/Driver/Driver.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ struct CompileOptions {
7474
bool TranslateLegacyMemoryIntrinsics = false;
7575
// -disable-finalizer-msg
7676
bool DisableFinalizerMsg = false;
77+
// -fno-struct-splitting
78+
bool DisableStructSplitting = false;
7779

7880
OptimizerLevel OptLevel = OptimizerLevel::Full;
7981
llvm::Optional<unsigned> StackMemSize;

IGC/VectorCompiler/include/vc/Support/BackendConfig.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ struct GenXBackendOptions {
6868
// Non-owning pointer to ShaderOverride interface
6969
vc::ShaderOverrider *ShaderOverrider = nullptr;
7070

71+
// Flag to turn off StructSpliter pass
72+
bool DisableStructSplitting = false;
73+
7174
// Whether to enable finalizer dumps.
7275
bool EnableAsmDumps;
7376
// Whether to enable dumps of kernel debug information
@@ -238,6 +241,8 @@ class GenXBackendConfig : public ImmutablePass {
238241
return Options.WATable;
239242
}
240243

244+
bool doStructSplitting() const { return !Options.DisableStructSplitting; }
245+
241246
bool useBindlessBuffers() const { return Options.UseBindlessBuffers; }
242247

243248
bool saveStackCallLinkage() const { return Options.SaveStackCallLinkage; }

IGC/VectorCompiler/lib/Driver/Driver.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ static GenXBackendOptions createBackendOptions(const vc::CompileOptions &Opts) {
223223
BackendOpts.EnableDebugInfoDumps = Opts.DumpDebugInfo;
224224
BackendOpts.Dumper = Opts.Dumper.get();
225225
BackendOpts.ShaderOverrider = Opts.ShaderOverrider.get();
226+
BackendOpts.DisableStructSplitting = Opts.DisableStructSplitting;
226227
BackendOpts.ForceArrayPromotion = (Opts.Binary == vc::BinaryKind::CM);
227228
if (Opts.ForceLiveRangesLocalizationForAccUsage)
228229
BackendOpts.LocalizeLRsForAccUsage = true;
@@ -584,6 +585,8 @@ static Error fillApiOptions(const opt::ArgList &ApiOptions,
584585
Opts.EmitDebugInformation = true;
585586
Opts.EmitDebuggableKernels = true;
586587
}
588+
if (ApiOptions.hasArg(OPT_vc_fno_struct_splitting))
589+
Opts.DisableStructSplitting = true;
587590
if (ApiOptions.hasArg(OPT_vc_fno_jump_tables))
588591
Opts.NoJumpTables = true;
589592
if (ApiOptions.hasArg(OPT_vc_ftranslate_legacy_memory_intrinsics))

IGC/VectorCompiler/lib/GenXCodeGen/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ set(CODEGEN_SOURCES
8282
GenXVisaRegAlloc.cpp
8383
GenXVisa.cpp
8484
OCLRuntimeInfoPrinter.cpp
85+
GenXStructSplitter.cpp
8586
)
8687

8788
add_library(VCCodeGen ${CODEGEN_SOURCES})

IGC/VectorCompiler/lib/GenXCodeGen/GenX.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ ModulePass *createGenXDebugInfoPass();
115115
ModulePass *createGenXGlobalValueLoweringPass();
116116
ModulePass *createGenXPromoteStatefulToBindlessPass();
117117
ModulePass *createGenXStackUsagePass();
118+
ModulePass *createGenXStructSplitterPass();
118119

119120
namespace genx {
120121

0 commit comments

Comments
 (0)