Do not use PropagateLineInfoPass and RedundantLineInfoElimPass (#2440)

* Do not use PropagateLineInfoPass and RedundantLineInfoElimPass

Since spirv-opt will remove PropagateLineInfoPass and
RedundantLineInfoElimPass, glslang should not use it. spirv-opt will
propagate the line instructions and eliminate the redundant lines by
default in IR loading/emission.

* Update known_good.json for spirv-tool
This commit is contained in:
Jaebaek Seo 2020-11-02 12:49:31 -05:00 committed by GitHub
parent 142cb87f80
commit ed8bd0453f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -174,10 +174,7 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
// line information into all SPIR-V instructions. This avoids loss of // line information into all SPIR-V instructions. This avoids loss of
// information when instructions are deleted or moved. Later, remove // information when instructions are deleted or moved. Later, remove
// redundant information to minimize final SPRIR-V size. // redundant information to minimize final SPRIR-V size.
if (options->generateDebugInfo) { if (options->stripDebugInfo) {
optimizer.RegisterPass(spvtools::CreatePropagateLineInfoPass());
}
else if (options->stripDebugInfo) {
optimizer.RegisterPass(spvtools::CreateStripDebugInfoPass()); optimizer.RegisterPass(spvtools::CreateStripDebugInfoPass());
} }
optimizer.RegisterPass(spvtools::CreateWrapOpKillPass()); optimizer.RegisterPass(spvtools::CreateWrapOpKillPass());
@ -207,9 +204,6 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
} }
optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass()); optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass()); optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
if (options->generateDebugInfo) {
optimizer.RegisterPass(spvtools::CreateRedundantLineInfoElimPass());
}
spvtools::OptimizerOptions spvOptOptions; spvtools::OptimizerOptions spvOptOptions;
optimizer.SetTargetEnv(MapToSpirvToolsEnv(intermediate.getSpv(), logger)); optimizer.SetTargetEnv(MapToSpirvToolsEnv(intermediate.getSpv(), logger));

View File

@ -5,7 +5,7 @@
"site" : "github", "site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Tools", "subrepo" : "KhronosGroup/SPIRV-Tools",
"subdir" : "External/spirv-tools", "subdir" : "External/spirv-tools",
"commit" : "a1d38174b1f7d2651c718ae661886d606cb50a32" "commit" : "56d0f50357a192602216bfc4873e714905323e35"
}, },
{ {
"name" : "spirv-tools/external/spirv-headers", "name" : "spirv-tools/external/spirv-headers",