Skip to content

Commit 6b931c1

Browse files
fda0igcbot
authored andcommitted
Remove ability to disable ZEBinary
This change removes the possiblity to disable ZEBin. It can be now only force enabled for platforms that do not support it.
1 parent 3c4bd03 commit 6b931c1

File tree

17 files changed

+25
-97
lines changed

17 files changed

+25
-97
lines changed

IGC/AdaptorOCL/dllInterfaceCompute.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,7 @@ bool ProcessElfInput(
841841
SetErrorMessage(
842842
"vISA linking can be used only with ZeBinary "
843843
"compiler output format. It seems that it is "
844-
"currently disabled for your platform. You can "
845-
"experiment with EnableZEBinary environmental "
846-
"flag to turn it on.",
844+
"currently disabled for your platform.",
847845
OutputArgs);
848846
return false;
849847
}

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.hpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,13 @@ namespace IGC
9292
}
9393
};
9494

95-
// If env flag is set, use it's value no matter what (works as "Force").
96-
if (IGC_IS_FLAG_SET(EnableZEBinary))
97-
m_enableZEBinary = IGC_IS_FLAG_ENABLED(EnableZEBinary);
98-
99-
// Runtime option precede supported platforms (can force zebin on unsupported).
100-
else if (m_InternalOptions.EnableZEBinary)
101-
m_enableZEBinary = *m_InternalOptions.EnableZEBinary;
102-
else if (m_Options.EnableZEBinary)
103-
m_enableZEBinary = *m_Options.EnableZEBinary;
104-
105-
// If platform is unsupported, disable regardless of the default.
106-
else if (!supportsZEBin(platform))
95+
if (m_InternalOptions.DisableZEBinary) {
96+
// Allow to disable ZEBin via internal options
10797
m_enableZEBinary = false;
108-
109-
// Set the default value from the flag table.
110-
else
111-
m_enableZEBinary = IGC_IS_FLAG_ENABLED(EnableZEBinary);
98+
} else {
99+
// Enable ZEBin for all supported platforms
100+
m_enableZEBinary = supportsZEBin(platform);
101+
}
112102
}
113103

114104
bool enableZEBinary() const override { return m_enableZEBinary; }

IGC/Compiler/CISACodeGen/OpenCLOptions.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,9 @@ void InternalOptions::parseOptions(const char* internalOpts)
204204
}
205205
}
206206

207-
if (internalOptions.hasArg(OPT_allow_zebin_common))
208-
{
209-
EnableZEBinary = true;
210-
}
211-
212207
if (internalOptions.hasArg(OPT_disable_zebin_common))
213208
{
214-
EnableZEBinary = false;
209+
DisableZEBinary = true;
215210
}
216211

217212
if (internalOptions.hasArg(OPT_exclude_ir_from_zebin_common))
@@ -583,15 +578,5 @@ void Options::parseOptions(const char* opts)
583578
// cannot HW support for double operations
584579
EnableFP64GenEmu = true;
585580
}
586-
587-
if (apiOptions.hasArg(OPT_enable_zebin_common))
588-
{
589-
EnableZEBinary = true;
590-
}
591-
592-
if (apiOptions.hasArg(OPT_disable_zebin_common))
593-
{
594-
EnableZEBinary = false;
595-
}
596581
}
597582
} // namespace IGC

IGC/Compiler/CISACodeGen/OpenCLOptions.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class InternalOptions
114114
uint32_t IntelScratchSpacePrivateMemoryMinimalSizePerThread = 0;
115115

116116
bool EnableDivergentBarrierHandling = false;
117-
std::optional<bool> EnableZEBinary;
117+
bool DisableZEBinary = false;
118118
bool EnableBufferBoundsChecking = false;
119119

120120
// Compile only up to vISA stage.
@@ -183,8 +183,6 @@ class Options
183183
// cannot HW support for double operations
184184
bool EnableFP64GenEmu = false;
185185

186-
std::optional<bool> EnableZEBinary;
187-
188186
private:
189187
void parseOptions(const char* opts);
190188
};

IGC/Compiler/tests/DebugInfo/SPIRMetaDataTranslation.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ attributes #3 = { nounwind readnone }
139139
!15 = !{!"intel_reqd_sub_group_size", i32 16}
140140
!16 = !{!"ModuleMD", !17, !18, !59}
141141
!17 = !{!"isPrecise", i1 false}
142-
!18 = !{!"compOpt", !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41, !42, !43, !44, !45, !46, !47, !48, !49, !50, !51, !52, !53, !54, !55, !56, !57, !58}
142+
!18 = !{!"compOpt", !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41, !42, !43, !44, !45, !46, !47, !48, !49, !50, !51, !52, !53, !54, !55, !56, !57}
143143
!19 = !{!"DenormsAreZero", i1 false}
144144
!20 = !{!"CorrectlyRoundedDivSqrt", i1 false}
145145
!21 = !{!"OptDisable", i1 false}
@@ -179,7 +179,6 @@ attributes #3 = { nounwind readnone }
179179
!55 = !{!"FastVISACompile", i1 false}
180180
!56 = !{!"MatchSinCosPi", i1 false}
181181
!57 = !{!"CaptureCompilerStats", i1 false}
182-
!58 = !{!"EnableZEBinary", i1 false}
183182
!59 = !{!"FuncMD", !60, !61}
184183
!60 = !{!"FuncMDMap[0]", void (i64 addrspace(1)*)* @test_spir}
185184
!61 = !{!"FuncMDValue[0]", !62, !63}

IGC/Compiler/tests/OpenCLPrintfResolution/basic.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
;============================ end_copyright_notice =============================
88
; REQUIRES: regkeys
99
;
10-
; RUN: igc_opt -regkey EnableZEBinary=0 -igc-opencl-printf-resolution -S < %s | FileCheck %s
10+
; RUN: igc_opt --platformglk -igc-opencl-printf-resolution -S < %s | FileCheck %s
1111
; ------------------------------------------------
1212
; OpenCLPrintfResolution
1313
; ------------------------------------------------

IGC/Compiler/tests/ProgramScopeConstantAnalysis/printf-string-constant.ll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
;============================ end_copyright_notice =============================
88
; REQUIRES: regkeys
99
; RUN: igc_opt -igc-programscope-constant-analysis -igc-serialize-metadata \
10-
; RUN: -S -regkey EnableZEBinary=1 < %s | FileCheck %s
10+
; RUN: -S < %s | FileCheck %s
1111
; ------------------------------------------------
1212
; ProgramScopeConstantAnalysis
1313
; ------------------------------------------------
1414

15-
; Test checks that metadata is updated with correct string constants when EnableZEBinary=1
15+
; Test checks that metadata is updated with correct string constants
16+
; (this tested the case with EnableZEBinary=1 which is the default now)
1617

1718
; CHECK: !{!"stringConstants",
1819
; CHECK-DAG: !{!"stringConstantsSet{{[[][0-9][]]}}", [3 x i8] addrspace(2)* @opencl_printf_str}

IGC/Compiler/tests/ProgramScopeConstantAnalysis/relaxed-printf-address-space.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
;============================ end_copyright_notice =============================
88
; REQUIRES: regkeys
99
; RUN: igc_opt -igc-programscope-constant-analysis -igc-serialize-metadata \
10-
; RUN: -S -regkey EnableZEBinary=1 < %s | FileCheck %s
10+
; RUN: -S < %s | FileCheck %s
1111
; ------------------------------------------------
1212
; ProgramScopeConstantAnalysis
1313
; ------------------------------------------------
1414

1515
; Test checks that metadata can be updated correctly with non-constant address
16-
; space string constants after the address space requirement is relaxed when
17-
; EnableZEBinary=1
16+
; space string constants after the address space requirement is relaxed
17+
; (this tested the case with EnableZEBinary=1 which is the default now)
1818

1919
; CHECK: !{!"stringConstants",
2020
; CHECK-DAG: !{!"stringConstantsSet{{[[][0-9][]]}}", [3 x i8] addrspace(2)* @fmt_str}

IGC/Compiler/tests/ProgramScopeConstantResolution/basic.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
;============================ end_copyright_notice =============================
88
; REQUIRES: regkeys
99
;
10-
; RUN: igc_opt -regkey EnableZEBinary=0 -enable-debugify --igc-programscope-constant-resolve -S < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,%LLVM_DEPENDENT_CHECK_PREFIX%
10+
; RUN: igc_opt -enable-debugify --igc-programscope-constant-resolve -S < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,%LLVM_DEPENDENT_CHECK_PREFIX%
1111
; ------------------------------------------------
1212
; ProgramScopeConstantResolution
1313
; ------------------------------------------------

IGC/Compiler/tests/ProgramScopeConstantResolution/offset_minus_one.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
;============================ end_copyright_notice =============================
88
; REQUIRES: regkeys
99
;
10-
; RUN: igc_opt -regkey EnableZEBinary=0 -enable-debugify --igc-programscope-constant-resolve -S < %s 2>&1 | FileCheck %s
10+
; RUN: igc_opt -enable-debugify --igc-programscope-constant-resolve -S < %s 2>&1 | FileCheck %s
1111
; ------------------------------------------------
1212
; ProgramScopeConstantResolution
1313
; ------------------------------------------------

IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,10 +1352,6 @@ namespace TC
13521352
(strcmp(pParam, "-ze-force-global-mem-allocation") == 0) || // temp
13531353
(strcmp(pParam, "-cl-no-local-to-generic") == 0) || // temp
13541354
(strcmp(pParam, "-ze-no-local-to-generic") == 0) || // temp
1355-
(strcmp(pParam, "-cl-disable-zebin") == 0) ||
1356-
(strcmp(pParam, "-ze-disable-zebin") == 0) ||
1357-
(strcmp(pParam, "-cl-enable-zebin") == 0) ||
1358-
(strcmp(pParam, "-ze-enable-zebin") == 0) ||
13591355
(strcmp(pParam, "-cl-intel-debug-info") == 0) ||
13601356
(strncmp(pParam, "-dump-opt-llvm", 14) == 0) ||
13611357
(strcmp(pParam, "-cl-no-subgroup-ifp") == 0) ||

IGC/Options/include/igc/Options/CommonApiOptions.td

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ defm library_compilation : CommonFlag<"library-compilation">;
4747
defm library_compile_simd : CommonSeparate<"library-compile-simd">;
4848
defm : CommonJoined<"library-compile-simd=">, Alias<library_compile_simd_common>;
4949

50-
// -cl-enable-zebin, -ze-enable-zebin
51-
defm enable_zebin : CommonFlag<"enable-zebin">,
52-
HelpText<"Emit level zero binary (zebin)">;
53-
54-
// -cl-disable-zebin, -ze-disable-zebin
55-
defm disable_zebin : CommonFlag<"disable-zebin">,
56-
HelpText<"Emit binary in legacy format">;
57-
5850
defm exp_register_file_size : CommonSeparate<"exp-register-file-size">,
5951
HelpText<"Set amount of registers used by regalloc">;
6052
defm : CommonJoined<"exp-register-file-size=">, Alias<exp_register_file_size_common>,

IGC/Options/include/igc/Options/CommonInternalOptions.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ defm emit_zebin_visa_sections : CommonFlag<"emit-zebin-visa-sections">,
2323
def emit_visa_only : PlainFlag<"emit-visa-only">,
2424
HelpText<"Compile until vISA">;
2525

26-
// -cl-allow-zebin, -ze-allow-zebin
27-
defm allow_zebin : CommonFlag<"allow-zebin">,
28-
HelpText<"Emit level zero binary">;
29-
3026
// -cl-disable-zebin, -ze-disable-zebin
3127
defm disable_zebin : CommonFlag<"disable-zebin">,
3228
HelpText<"Emit binary in legacy format">;

IGC/VectorCompiler/igcdeps/src/TranslationInterface.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,16 +265,10 @@ static void adjustDebugStrippingPolicy(vc::CompileOptions &Opts) {
265265
// Overwrite binary format option for backward compatibility with
266266
// environment variable approach.
267267
static void adjustBinaryFormat(vc::BinaryKind &Binary) {
268-
if (Binary == vc::BinaryKind::CM)
268+
if (Binary != vc::BinaryKind::Default)
269269
return;
270270

271-
if (Binary != vc::BinaryKind::Default && !IGC_IS_FLAG_SET(EnableZEBinary))
272-
return;
273-
274-
if (IGC_IS_FLAG_ENABLED(EnableZEBinary))
275-
Binary = vc::BinaryKind::ZE;
276-
else
277-
Binary = vc::BinaryKind::OpenCL;
271+
Binary = vc::BinaryKind::OpenCL;
278272
}
279273

280274
template <typename T> T deriveDefaultableFlagValue(int Flag) {

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ struct CompileOptions {
6161
std::string ApiOptions;
6262

6363
// Output binary format
64-
// API options:
65-
// -[cl,ze]-enable-zebin
66-
/// -[cl,ze]-disable-zebin
6764
// Internal options:
68-
// -[cl,ze]-allow-zebin
6965
// -[cl,ze]-disable-zebin
7066
// -binary-format=[ocl,ze,cm]
7167
// Debug keys:

IGC/VectorCompiler/lib/Driver/Driver.cpp

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -740,19 +740,6 @@ static Error fillApiOptions(const opt::ArgList &ApiOptions,
740740
Opts.GRFSize = MaybeGRFSize;
741741
}
742742

743-
if (opt::Arg *A =
744-
ApiOptions.getLastArg(OPT_enable_zebin_common, OPT_disable_zebin_common))
745-
switch (A->getOption().getID()) {
746-
case OPT_enable_zebin_common:
747-
Opts.Binary = vc::BinaryKind::ZE;
748-
break;
749-
case OPT_disable_zebin_common:
750-
Opts.Binary = vc::BinaryKind::OpenCL;
751-
break;
752-
default:
753-
break;
754-
}
755-
756743
if (opt::Arg *A = ApiOptions.getLastArg(OPT_fp_contract)) {
757744
StringRef Val = A->getValue();
758745
auto MayBeAllowFPOPFusion =
@@ -843,14 +830,11 @@ static Error fillInternalOptions(const opt::ArgList &InternalOptions,
843830
Opts.InteropSubgroupSize = MaybeSize.getValue();
844831
}
845832

846-
if (opt::Arg *A = InternalOptions.getLastArg(
847-
OPT_binary_format, OPT_allow_zebin_common, OPT_disable_zebin_common)) {
833+
if (opt::Arg* A = InternalOptions.getLastArg(
834+
OPT_binary_format, OPT_disable_zebin_common)) {
848835
auto OptID = A->getOption().getID();
849-
850-
if (OptID == OPT_allow_zebin_common)
851-
Opts.Binary = vc::BinaryKind::ZE;
852-
else if (OptID == OPT_disable_zebin_common)
853-
Opts.Binary = vc::BinaryKind::OpenCL;
836+
if (OptID == OPT_disable_zebin_common)
837+
Opts.Binary = vc::BinaryKind::OpenCL;
854838
else {
855839
StringRef Val = A->getValue();
856840
auto MaybeBinary = StringSwitch<Optional<vc::BinaryKind>>(Val)

IGC/common/igc_flags.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,6 @@ DECLARE_IGC_REGKEY(bool, EnableLocalIdCalculationInShader, false,
807807
"used.", true)
808808
DECLARE_IGC_REGKEY(int, JointMatrixLoadStoreOpt, 3, "Selects subgroup (0), or block read/write (1), or optimized block read/write (2), 2d block read/write (3) implementation of Joint Matrix Load/Store built-ins", true)
809809
DECLARE_IGC_REGKEY(bool, EnableVector8LoadStore, false, "Enable Vectorizer to generate 8x32i and 4x64i loads and stores", true)
810-
DECLARE_IGC_REGKEY(bool, EnableZEBinary, true, "Force-enable output in ZE binary format. Leave unset for compiler to choose based on current platform's support for ZE binary", true)
811810
DECLARE_IGC_REGKEY(bool, ExcludeIRFromZEBinary, false, "Exclude IR sections from ZE binary", true)
812811
DECLARE_IGC_REGKEY(bool, AllocateZeroInitializedVarsInBss, true, "Allocate zero initialized global variables in .bss section in ZEBinary", true)
813812
DECLARE_IGC_REGKEY(DWORD, OverrideOCLMaxParamSize, 0, "Override the value imposed on the kernel by CL_DEVICE_MAX_PARAMETER_SIZE. Value in bytes, if value==0 no override happens.", true)

0 commit comments

Comments
 (0)